From 5a82b9258c237f3d8e235e71775f9e27a1991a69 Mon Sep 17 00:00:00 2001 From: flashwave Date: Fri, 13 Oct 2023 19:35:06 +0000 Subject: [PATCH] fix error --- src/AssetsInfo.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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); }