From f715acec30899d68242758ca8189fc4deea9b46f Mon Sep 17 00:00:00 2001 From: noikiy Date: Tue, 25 Jul 2023 09:21:54 +0800 Subject: [PATCH] fixed undefined --- src/Utils/Version.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Utils/Version.php b/src/Utils/Version.php index 5c31631..a3fb83b 100644 --- a/src/Utils/Version.php +++ b/src/Utils/Version.php @@ -46,7 +46,7 @@ public function findBestCandidate(Composer $composer, string $packageName, Repos $bestCandidate = $this->findBestCandidateComposer2($composer, $packageName, $repository); } - if($bestCandidate instanceof PackageInterface){ + if (isset($bestCandidate) && $bestCandidate instanceof PackageInterface) { return $bestCandidate; } return null;