title: Product currency could not working, i getting error in Modx System
body: <p>I have use Modx CMS. today i get this error. Bellow my error line. </p>
  
  <p>Fatal error: Call to a member function get() on null in /var/www/bottega/core/cache/includes/elements/modsnippet/63.include.cache.php on line 24</p>
  
  <pre><code>$id = $row['id'];
  $product = $modx-&gt;getObject('modResource',  $id)-&gt;Product;
  $price = $product-&gt;sm_price;
  $currency = (int)$product-&gt;sm_currency; //$currency out is 153 dynamically
  $currency =  $modx-&gt;getObject('modResource', trim($currency))-&gt;get('longtitle'); //this line number 24
  </code></pre>
  
  <p>Actually, when i initialize manually <code>$currency</code> variable <code>153</code> then this problem solve. but when i use <code>$currency</code> initialize from database <code>(int)$product-&gt;sm_currency;</code> it show error</p>
  
  <pre><code>Fatal error: Call to a member function get() on null in /var/www/bottega/core/cache/includes/elements/modsnippet/63.include.cache.php on line 24
  </code></pre>
  
  <p>For example <code>$currency</code> variable manually initialize with 153</p>
  
  <pre><code>$id = $row['id'];
  $product = $modx-&gt;getObject('modResource',  $id)-&gt;Product;
  $price = $product-&gt;sm_price;
  $currency = 153; 
  $currency =  $modx-&gt;getObject('modResource', trim($currency))-&gt;get('longtitle'); //this line number 24
  </code></pre>
  
  <p>Now work fine</p>