Skip to content

Commit 7da4ffa

Browse files
committed
🐛 fix: when content is empty
Signed-off-by: otengkwame <[email protected]>
1 parent 71e316d commit 7da4ffa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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)