From b2460e88c7d050659179d7a6e24a10b0616d3cac Mon Sep 17 00:00:00 2001 From: Joe Date: Tue, 28 Jun 2022 10:30:24 +0200 Subject: [PATCH] Bug 5599: Generating an EAN-8 Barcode throws an error "Trying to access array offset on value of type bool". Fixed. --- inventory/manage/items.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inventory/manage/items.php b/inventory/manage/items.php index fe4e82b1..54978382 100644 --- a/inventory/manage/items.php +++ b/inventory/manage/items.php @@ -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 = ""; -- 2.30.2