From 89a287a94c41a8691b329521498d33679241b063 Mon Sep 17 00:00:00 2001 From: Michael Becker Date: Mon, 13 Jan 2025 23:44:34 -0500 Subject: [PATCH] don't choke if we get a bad JSON result --- .../src/mocha-php/lib/mocha/oms/HttpOmsClient.inc.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mocha-php/src/mocha-php/lib/mocha/oms/HttpOmsClient.inc.php b/mocha-php/src/mocha-php/lib/mocha/oms/HttpOmsClient.inc.php index 141397e..8850e5b 100644 --- a/mocha-php/src/mocha-php/lib/mocha/oms/HttpOmsClient.inc.php +++ b/mocha-php/src/mocha-php/lib/mocha/oms/HttpOmsClient.inc.php @@ -153,9 +153,12 @@ public function isConnected() : bool { $json = $this->curl_request_json("/ping"); - if ($json["result"] == "success") + if (is_array($json)) { - return true; + if ($json["result"] == "success") + { + return true; + } } return false; }