fix error
This commit is contained in:
parent
e2454e1002
commit
5a82b9258c
1 changed files with 4 additions and 2 deletions
|
@ -20,9 +20,11 @@ final class AssetsInfo {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function fromFile(string $path): self {
|
public static function fromFile(string $path): self {
|
||||||
$body = file_get_contents($path);
|
try {
|
||||||
if($body === false)
|
$body = file_get_contents($path);
|
||||||
|
} catch(\ErrorException $ex) {
|
||||||
return new static([]);
|
return new static([]);
|
||||||
|
}
|
||||||
|
|
||||||
return self::fromJson($body);
|
return self::fromJson($body);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue