Unhandled Error!

Trying to get property of non-object

Document Product
Document type CMS page POST action code
Line 4
Exception class Cms_ExecutionException

Code Highlight

	$unavail = false;
	$productUnavailable_url_name = $this->request_param(0);
	$productUnavailable = Shop_Product::create()->where('(shop_products.grouped is null or (shop_products.grouped is not null and shop_products.product_id is not null))')->find_by_url_name($productUnavailable_url_name);
	if (!$productUnavailable->enabled || ($productUnavailable->is_out_of_stock() && $productUnavailable->hide_if_out_of_stock)){
		$unavail = true;
	}
	if ($productUnavailable->disable_completely) $unavail = false;
if($unavail){
	if($productUnavailable->garbee_preorder) {
		$this->data['product'] = $productUnavailable;
		$this->data['product_unavailable'] = false;
	}
}
# Document Type
1 Product CMS page POST action code