diff --git a/src/AssetsInfo.php b/src/AssetsInfo.php index c20a334..5651a74 100644 --- a/src/AssetsInfo.php +++ b/src/AssetsInfo.php @@ -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); }