Mysqli errors: Trying to access array offset on value of type bool. Fixed. Please...
[fa-stable.git] / sales / includes / db / sales_invoice_db.inc
index c17e9214e361e936664bbdf93a68c736765d4edc..b1cbfa3f8209fbc5cfde929b3a13274c7c18d447 100644 (file)
@@ -291,7 +291,7 @@ function get_cust_prepayment_invoice_factor($trans_no)
                LEFT JOIN ".TB_PREF."sales_orders so ON so.trans_type=".ST_SALESORDER." AND so.order_no=dt.order_
                 WHERE dt.type=".ST_SALESINVOICE." AND trans_no=".db_escape($trans_no);
        $row = db_fetch(db_query($sql, 'cannot retrieve prepaid invoice factor'));
-       return $row[0];
+       return is_array($row) ? $row[0] : false;
 }
 
 /*