title: Codeigniter row() on a non-object
body: <p>I have problem with ION Auth library. I want to edit existing group and when i try to dedit i have this error:</p>
  
  <p>Where is mistake, i explore all and CI doc but all looks fine. </p>
  
  <blockquote>
    <p>Fatal error: Call to a member function row() on a non-object in
    /var/www/ci_balcanrent/beta/modules/user/controllers/user.php on line
    603</p>
  </blockquote>
  
  <p>Here is controller for edit function: </p>
  
  <pre><code>   //edit a group
      function edit_group($id) {
          // bail if no group id given
          if (!$id || empty($id)) {
              redirect('user', 'refresh');
          }
  
          $this-&gt;data['title'] = $this-&gt;lang-&gt;line('edit_group_title');
  
          if (!$this-&gt;ion_auth-&gt;logged_in() || !$this-&gt;ion_auth-&gt;is_admin()) {
              redirect('user', 'refresh');
          }
  
          $group = $this-&gt;ion_auth-&gt;group($id)-&gt;row();
  
          //validate form input
          $this-&gt;form_validation-&gt;set_rules('group_name', $this-&gt;lang-&gt;line('edit_group_validation_name_label'), 'required|alpha_dash|xss_clean');
          $this-&gt;form_validation-&gt;set_rules('group_description', $this-&gt;lang-&gt;line('edit_group_validation_desc_label'), 'xss_clean');
  
          if (isset($_POST) &amp;&amp; !empty($_POST)) {
              if ($this-&gt;form_validation-&gt;run() === TRUE) {
                  $group_update = $this-&gt;ion_auth-&gt;update_group($id, $_POST['group_name'], $_POST['group_description']);
  
                  if ($group_update) {
                      $this-&gt;session-&gt;set_flashdata('success', $this-&gt;lang-&gt;line('edit_group_saved'));
                  } else {
                      $this-&gt;session-&gt;set_flashdata('error', $this-&gt;ion_auth-&gt;errors());
                  }
                  redirect("user", 'refresh');
              }
          }
  
          //set the flash data error message if there is one
          $this-&gt;data['message'] = (validation_errors() ? validation_errors() : ($this-&gt;ion_auth-&gt;errors() ? $this-&gt;ion_auth-&gt;errors() : $this-&gt;session-&gt;flashdata('error')));
  
          //pass the user to the view
          $this-&gt;data['group'] = $group;
  
          $this-&gt;data['group_name'] = array(
              'name' =&gt; 'group_name',
              'id' =&gt; 'group_name',
              'type' =&gt; 'text',
              'value' =&gt; $this-&gt;form_validation-&gt;set_value('group_name', $group-&gt;name),
          );
          $this-&gt;data['group_description'] = array(
              'name' =&gt; 'group_description',
              'id' =&gt; 'group_description',
              'type' =&gt; 'text',
              'value' =&gt; $this-&gt;form_validation-&gt;set_value('group_description', $group-&gt;description),
          );
  
          $this-&gt;template-&gt;build('auth/edit_group', $this-&gt;data);
      }
  </code></pre>
  
  <p><strong>603 Line</strong>      <strong>$group = $this->ion_auth->group($id)->row();</strong></p>
  
  <p><strong>Model :</strong></p>
  
  <pre><code>/**
       * group
       *
       * @return object
       * @author Ben Edmunds
       **/
      public function group($id = NULL)
      {
          $this-&gt;trigger_events('group');
  
          if (isset($id))
          {
              $this-&gt;db-&gt;where($this-&gt;tables['groups'].'.id', $id);
          }
  
          $this-&gt;limit(1);
  
          return $this-&gt;groups();
      }
  </code></pre>
  
  <p><strong>View:</strong></p>
  
  <pre><code>&lt;?php echo form_open(current_url());?&gt;
  
        &lt;p&gt;
              &lt;?php echo lang('create_group_name_label', 'group_name');?&gt; &lt;br /&gt;
              &lt;?php echo form_input($group_name);?&gt;
        &lt;/p&gt;
  
        &lt;p&gt;
              &lt;?php echo lang('edit_group_desc_label', 'description');?&gt; &lt;br /&gt;
              &lt;?php echo form_input($group_description);?&gt;
        &lt;/p&gt;
  
        &lt;p&gt;&lt;?php echo form_submit('submit', lang('edit_group_submit_btn'));?&gt;&lt;/p&gt;
  
  &lt;?php echo form_close();?&gt;
  </code></pre>