Unhandled Error!

Trying to get property of non-object

Document Product Category Page
Document type CMS page
Line 1
Exception class Cms_ExecutionException

Code Highlight

<? if ($category->parent==NULL || $category->parent->name=='Catalog') { 
$subcategories = $category->list_children('front_end_sort_order');	
?>
<div class="row wide cat-row">
	<div class="twelve columns">
		<ul class="block-grid <?= numToWord($subcategories->count); ?>-up mobile-one-up">
		<? foreach ($subcategories as $sc) { ?>
			<li class="nomar nopad cat-block">
				<a class="" href="<?= $sc->page_url('/products'); ?>">
					<div class="img" style="background: url(<?= site_url() . $sc->images->first->getThumbnailPath('auto', 'auto') ?>) center center no-repeat;background-size:cover;"></div>
					<div class="desc text-center">
						<h1 class="nomar"><?= $sc->name ?></h1>
						<p class="nomar"><em><?= $sc->short_description; ?></em></p>
# Document Type
1 Product Category Page CMS page