Skip to content

Commit 7da4ffa

Browse files
committed
🐛 fix: when content is empty
Signed-off-by: otengkwame <developerkwame@gmail.com>
1 parent 71e316d commit 7da4ffa

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Core/core/Json/Db.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ private function fileExists()
261261
} else {
262262
// Read content of JSON file
263263
$content = file_get_contents($this->file);
264-
$content = json_decode($content, true);
264+
$content = json_decode(($content == '') ? '[]' : $content, true);
265265
}
266266

267267
// Check if its arrays of JSON

0 commit comments

Comments
 (0)