From 26f8e9f4ae092e3395edd6e7a1ab3e083340cb26 Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Tue, 9 Nov 2021 10:30:18 +1300 Subject: [PATCH] FIX Ensure composer.json file exists before reading it --- src/Library.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Library.php b/src/Library.php index 152d075..8b4a073 100644 --- a/src/Library.php +++ b/src/Library.php @@ -185,6 +185,9 @@ protected function getJson() return $this->json; } $composer = Util::joinPaths($this->getPath(), 'composer.json'); + if (!file_exists($composer)) { + return []; + } $file = new JsonFile($composer); $this->json = $file->read(); return $this->json;