From 3ee13c26704b5296a8fe3e808aa271a8f49c0813 Mon Sep 17 00:00:00 2001 From: cmp167 Date: Sun, 31 Dec 2023 07:43:52 +1200 Subject: [PATCH] Accept empty array for decodeJSON --- cmpUtil.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmpUtil.php b/cmpUtil.php index f882d6a..4f49a2f 100644 --- a/cmpUtil.php +++ b/cmpUtil.php @@ -164,8 +164,12 @@ $obj = $this->decodeJSON($raw, 1); + if(is_array($obj)) { + return $obj; + } + if(!$obj) { - $this->e("Invalid JSON '$file'"); + $this->e("Invalid JSON file '$file'"); return false; }