From f924a2b2b3a8a6c53ce050da64e57ac76d388872 Mon Sep 17 00:00:00 2001 From: fredtempez Date: Thu, 14 Mar 2024 19:09:00 +0100 Subject: [PATCH] stop on json data error --- core/class/jsondb/JsonDb.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/class/jsondb/JsonDb.class.php b/core/class/jsondb/JsonDb.class.php index 3e3b26cf..0061417b 100644 --- a/core/class/jsondb/JsonDb.class.php +++ b/core/class/jsondb/JsonDb.class.php @@ -129,7 +129,7 @@ class JsonDb extends \Prowebcraft\Dot } } $this->data = json_decode(file_get_contents($this->db), true); - if (!$this->data === null) { + if (!$this->data === null && json_last_error() !== JSON_ERROR_NONE) { throw new \InvalidArgumentException('Database file ' . $this->db . ' contains invalid json object. Please validate or remove file'); }