Unhandled Error!

Trying to get property of non-object

Document Product details page.
Document type CMS page
Line 2
Exception class Cms_ExecutionException

Code Highlight

<?
if ($product->category_list[0] != NULL) {
	$category = $product->category_list[0];
	$subcats = $category->list_children('front_end_sort_order');
	if(!$subcats->count && $category->parent != NULL) {
		$subcats = $category->parent->list_children('front_end_sort_order');
	}
?>
 
<? $this->render_partial('menu:second_nav', array('subcats'=>$subcats, 'category'=>$category)); ?>
 
<div class="row">
	<div class="twelve columns">
# Document Type
1 Product details page. CMS page