Unhandled Error!

Trying to get property of non-object

Document shop
Document type CMS page POST action code
Line 2
Exception class Cms_ExecutionException

Code Highlight

$category = $this->data["category"];
$category_name = ( $category->parent == null )? $category->url_name: $category->parent->url_name;
Cms_VisitorPreferences::set( "category_name", $category_name );
Cms_VisitorPreferences::set( "categories", null );
 
//allitems that are out of stock
$queryOutOfStock ="
SELECT products.shop_product_id FROM (
SELECT
 
	sspo.in_stock
	,sspo.shop_option_matrix_record_id
	,sspo.shop_product_id
# Document Type
1 shop CMS page POST action code