ErrorException [ Notice ]: Trying to access array offset on value of type null

APPPATH/classes/Controller/Object.php [ 19 ]

14             ->where('emap_objects.slug', '=', $slug)
15             ->limit(1)->execute();
16 
17 
18 
19         $nearestObjects = DB::select('emap_objects.*', [DB::expr('geodist('.$object[0]['lat'].', '.$object[0]['lon'].', lat, lon)'), 'dist'], ['emap_categories.title', 'category'], ['emap_categories.slug', 'category_slug'])
20             ->from('emap_objects')
21             ->join('emap_categories')->on('emap_objects.category_id', '=', 'emap_categories.id')
22             ->where(DB::expr('length(image)'), '>', 0)
23             ->and_where('emap_objects.id', '!=', $object[0]['id'])
24            // ->and_where('emap_objects.category_id', '!=', 7)
  1. APPPATH/classes/Controller/Object.php [ 19 ] » Kohana_Core::error_handler(arguments)

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

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

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

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

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

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

Environment