title: Call to a member function getData() on a non-object in Magento Extension
body: <p>Hello Magento Experts,</p>
  
  <p>I developed a <code>Magento Extension</code> which is working fine on <code>Version 1.6 and 1.7</code>, but when i installed it on <code>Version 1.5</code>, it is giving me an error : </p>
  
  <pre><code>Fatal error: Call to a member function getData() on a non-object in /home/broadcas/public_html/app/code/community/Gwb/Magecrmsync/controllers/Adminhtml/OrdersController.php on line 18
  </code></pre>
  
  <p>Below is my <code>OrderController.php</code> Code. </p>
  
  <pre><code>&lt;?php
  class Gwb_Magecrmsync_Adminhtml_OrdersController extends Mage_Adminhtml_Controller_Action
  {
  public function indexAction()
  {
      $model = Mage::getModel('sales/order');
  
      $collection = $model-&gt;getCollection()
      -&gt;addFieldToFilter('status', array("in" =&gt; array('complete','closed','pending','holded','payment_review','pending_payment','pending_paypal','processing')));
  
      $data = array();
      $orderArr = array();
  
      // getting order details
  
      $records = 0;
      foreach($collection as $order)
      {
          $data[$records]['order_data']['shipping_address'] = $order-&gt;getShippingAddress()-&gt;getData(); // get shipping details
          $data[$records]['order_data']['billing_address'] = $order-&gt;getBillingAddress()-&gt;getData(); // get billing details
          $data[$records]['order_data']['order_total'] = $order-&gt;getGrandTotal(); // get total amount
          $data[$records]['order_data']['shipping_amount'] = $order-&gt;getShippingAmount();
          $data[$records]['order_data']['order_details'] = $order-&gt;toArray();
          $records++;
      }
  
      // getting order details
  
  }
  }
  </code></pre>
  
  <p>Can anyone please guide me what am i doing wrong which doesn't work in <code>Version 1.5</code>.</p>
  
  <p>Any help would be appreciated.</p>
  
  <p>Thanks</p>