Unhandled Error!

Trying to get property of non-object

Document shop:product_group
Document type CMS partial
Line 35
Exception class Cms_ExecutionException

Code Highlight

      if (post('sorting'))
        Cms_VisitorPreferences::set('cat_sorting_'.$group->id, post('sorting'));
 
      /*
       * Load the product sorting mode. The default mode is 'name'.
       */
      $sorting_preferences = Cms_VisitorPreferences::get('cat_sorting_'.$group->id, array('name'));
 
      $selected_option = $sorting_preferences[0];
 
    ?>      
    <select tabindex="1" class="sorting dk" id="form_sort" onchange="$(this).getForm().sendRequest(
    'on_action', {
# Document Type
3 shop:product_group CMS partial
2 layout:age_group CMS partial
1 Age From Birth (Toys & Games) CMS page