diff --git a/src/Command/CheckCommand.php b/src/Command/CheckCommand.php index d52e6d6..20ad85e 100644 --- a/src/Command/CheckCommand.php +++ b/src/Command/CheckCommand.php @@ -107,9 +107,10 @@ protected function execute(InputInterface $input, OutputInterface $output): int } } - $drupalFinder->locateRoot($drupalRootCandidate); - $this->drupalRoot = realpath($drupalFinder->getDrupalRoot()); - $this->vendorRoot = realpath($drupalFinder->getVendorDir()); + if ($drupalFinder->locateRoot($drupalRootCandidate)) { + $this->drupalRoot = realpath($drupalFinder->getDrupalRoot()); + $this->vendorRoot = realpath($drupalFinder->getVendorDir()); + } if (!$this->drupalRoot) { $output->writeln(sprintf('Unable to locate the Drupal root in %s', $drupalRootCandidate));