Bug 5599: Generating an EAN-8 Barcode throws an error "Trying to access array offset...
authorJoe <joe.hunt.consulting@gmail.com>
Tue, 28 Jun 2022 08:30:24 +0000 (10:30 +0200)
committerJoe <joe.hunt.consulting@gmail.com>
Tue, 28 Jun 2022 08:30:24 +0000 (10:30 +0200)
inventory/manage/items.php

index fe4e82b1d26214b04cfaf1d063c9834a59050d96..5497838254b515ee22444ab33e8009376406733d 100644 (file)
@@ -686,7 +686,7 @@ function generateBarcode() {
                $query = "SELECT stock_id FROM ".TB_PREF."stock_master WHERE stock_id='" . $tmpBarcodeID . "'";
                $arr_stock = db_fetch(db_query($query));
   
-               if (  !$arr_stock['stock_id'] ) {
+               if (  !$arr_stock || !$arr_stock['stock_id'] ) {
                        return $tmpBarcodeID;
                }
                $tmpBarcodeID = "";