Unhandled Error!

Trying to get property of non-object

Document sidebar:category_list_product_page
Document type CMS partial
Line 6
Exception class Cms_ExecutionException

Code Highlight

<div class="sidebar-element">
 
	<?php
 
		/* Get the category */
		$category = $product->category_list[0];
 
		/* Show parent subcategories, if they exits */
		$parents = $category->get_parents();
		foreach ($parents as $parent):
			$subcategories = $parent->list_children('front_end_sort_order');
			$category_title = h($parent->name);
			break; /* Use first parent, only */
# Document Type
2 sidebar:category_list_product_page CMS partial
1 Product CMS page