Error

We're sorry, but an unhandled error occurred. Please see the details below.

Trying to get property of non-object

/usr/share/nginx/dev.sporttv.is/themes/stv/pages/frett.htm line 31

        			->with('categories');
 
        $post = $post->scopeFilterCategories($query, [$this['category']->id])->get();
        $post = $post->first();
 
        $this->page->title = $post->title;
 
        if($post->count() > 0) {
        	if($post->featured_images->count() > 0) {
        		foreach($post->featured_images as $image) {
        			$this['image'] = $image;
 
        			break;

Stack trace

# Called Code Document Line
18 Cms58ff24d65acf7_2996451786Class->onStart() http://sporttv.is/modules/cms/classes/Controller.php 623
17 Cms\Classes\Controller->execPageCycle() http://sporttv.is/modules/cms/classes/Controller.php 290
16 Cms\Classes\Controller->run()
15 call_user_func_array() http://sporttv.is/plugins/ziggy/htmlmin/vendor/illuminate/routing/Illuminate/Routing/Controller.php 231
14 Illuminate\Routing\Controller->callAction() http://sporttv.is/plugins/ziggy/htmlmin/vendor/illuminate/routing/Illuminate/Routing/ControllerDispatcher.php 93
13 Illuminate\Routing\ControllerDispatcher->call() http://sporttv.is/plugins/ziggy/htmlmin/vendor/illuminate/routing/Illuminate/Routing/ControllerDispatcher.php 62
12 Illuminate\Routing\ControllerDispatcher->dispatch() http://sporttv.is/vendor/laravel/framework/src/Illuminate/Routing/Router.php 962
11 Illuminate\Routing\Router->Illuminate\Routing\{closure}()
10 call_user_func_array() http://sporttv.is/plugins/ziggy/htmlmin/vendor/illuminate/routing/Illuminate/Routing/Route.php 109
9 Illuminate\Routing\Route->run() http://sporttv.is/vendor/laravel/framework/src/Illuminate/Routing/Router.php 1028
8 Illuminate\Routing\Router->dispatchToRoute() http://sporttv.is/vendor/laravel/framework/src/Illuminate/Routing/Router.php 996
7 Illuminate\Routing\Router->dispatch() http://sporttv.is/vendor/laravel/framework/src/Illuminate/Foundation/Application.php 775
6 Illuminate\Foundation\Application->dispatch() http://sporttv.is/vendor/laravel/framework/src/Illuminate/Foundation/Application.php 745
5 Illuminate\Foundation\Application->handle() http://sporttv.is/plugins/ziggy/htmlmin/vendor/illuminate/session/Illuminate/Session/Middleware.php 72
4 Illuminate\Session\Middleware->handle() http://sporttv.is/plugins/ziggy/htmlmin/vendor/illuminate/cookie/Illuminate/Cookie/Queue.php 47
3 Illuminate\Cookie\Queue->handle() http://sporttv.is/plugins/ziggy/htmlmin/vendor/illuminate/cookie/Illuminate/Cookie/Guard.php 51
2 Illuminate\Cookie\Guard->handle() http://sporttv.is/vendor/stack/builder/src/Stack/StackedHttpKernel.php 23
1 Stack\StackedHttpKernel->handle() http://sporttv.is/vendor/laravel/framework/src/Illuminate/Foundation/Application.php 641
0 Illuminate\Foundation\Application->run() http://sporttv.is/index.php 40