ErrorException [ Notice ]: Trying to get property 'privata' of non-object

APPPATH/classes/Controller/Home.php [ 777 ]

772 						 FROM blog_immagini
773 						 WHERE principale <> 1 AND  id_blog = '.$id.' 
774 						 ')->as_object()->execute();
775 
776 		$check = ORM::factory('Blog')->get_autorizzazione_news($id,  (isset(Auth::instance()->get_user()->id) ? Auth::instance()->get_user()->id : NULL));	
777   		if ($check == 0 && $object->privata == 1)
778   		$this->redirect(Helper_Redirect::set('/'));
779 
780 		
781 		$ris_foto =  DB::select()->from($suf.'_immagini')->where('id_blog', '=', $id)->where('principale', '!=', 1)
782 		                          ->as_object()->execute();
  1. APPPATH/classes/Controller/Home.php [ 777 ] » Kohana_Core::error_handler()

  2. SYSPATH/classes/Kohana/Controller.php [ 84 ] » Controller_Home->action_news_singola()

  3. {PHP internal call} » Kohana_Controller->execute()

  4. SYSPATH/classes/Kohana/Request/Client/Internal.php [ 97 ] » ReflectionMethod->invoke()

  5. SYSPATH/classes/Kohana/Request/Client.php [ 114 ] » Kohana_Request_Client_Internal->execute_request()

  6. SYSPATH/classes/Kohana/Request.php [ 993 ] » Kohana_Request_Client->execute()

  7. DOCROOT/index.php [ 119 ] » Kohana_Request->execute()

Environment