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

APPPATH/classes/Controller/Site.php [ 34 ]

29     	$therapeutika = util::findTherapeuticaFromUrl($this->request);
30 
31         $view->set("therapeutika", $therapeutika);
32 
33     	$res = DB::select('IDKategorie')->from('bc_KategorienTherapeutika')
34     	   ->where('IDTherapeutika', '=', $therapeutika->ID)
35     	   ->execute();
36         $cats = array();
37         foreach($res as $data) {
38             $c = ORM::factory('Kategorie', $data['IDKategorie'] );
39             array_push($cats, $c);
  1. APPPATH/classes/Controller/Site.php [ 34 ] » Kohana_Core::error_handler()

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

  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 [ 997 ] » Kohana_Request_Client->execute()

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

Environment