Skip to content

Commit

Permalink
feat(file): fixing json error detection
Browse files Browse the repository at this point in the history
  • Loading branch information
razshare committed Mar 3, 2024
1 parent d5cf337 commit 1f07190
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/Core/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ public static function readJson(string $interface, string $fileName):Unsafe {
return error($error);
}
$parsed = json_decode($contents, false);
if (false === $parsed) {
if (false === $parsed || null === $parsed) {
return error("Couldn't parse json file.");
}
return ok($parsed);
Expand Down

0 comments on commit 1f07190

Please sign in to comment.