From d27d54f7da460360ef6444c2b87c5ed7a5c453a2 Mon Sep 17 00:00:00 2001 From: Kendrick Chan Date: Sat, 16 Jul 2022 19:22:59 +0800 Subject: [PATCH] Fix motiv being down for getInventory --- src/Service/MotivConnector.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Service/MotivConnector.php b/src/Service/MotivConnector.php index 60847192..f0ee8bc1 100644 --- a/src/Service/MotivConnector.php +++ b/src/Service/MotivConnector.php @@ -32,7 +32,13 @@ class MotivConnector $res = $this->curlPost('InventoryService', $body_text); - return json_decode($res, true); + $inv_res = json_decode($res, true); + + // check result + if ($inv_res == null) + return []; + + return $inv_res; } protected function curlPost($url, $body)