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;