From d02f0f7d512690b8bf5ed70c1b8c99460a9cd40d Mon Sep 17 00:00:00 2001 From: Korina Cordero Date: Mon, 10 May 2021 06:25:59 +0000 Subject: [PATCH] Add checking for sku. #551 --- src/Controller/APIController.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Controller/APIController.php b/src/Controller/APIController.php index 099f45a3..127d37f8 100644 --- a/src/Controller/APIController.php +++ b/src/Controller/APIController.php @@ -3045,7 +3045,10 @@ class APIController extends Controller implements LoggedController } $sku = $warr_serial->getSKU(); - $batt = $em->getRepository(SAPBattery::class)->find($sku); + $batt = null; + if ($sku != null) + $batt = $em->getRepository(SAPBattery::class)->find($sku); + // TODO: put this in a config file $image_url = $req->getSchemeAndHttpHost() . '/battery/generic.png'; if ($batt != null)