fix error

This commit is contained in:
flash 2023-10-13 19:35:06 +00:00
parent e2454e1002
commit 5a82b9258c

View file

@ -20,9 +20,11 @@ final class AssetsInfo {
}
public static function fromFile(string $path): self {
$body = file_get_contents($path);
if($body === false)
try {
$body = file_get_contents($path);
} catch(\ErrorException $ex) {
return new static([]);
}
return self::fromJson($body);
}