From 7389b1550a4968dbfe3f6689f147e72077e3462a Mon Sep 17 00:00:00 2001 From: Matt Glaman Date: Mon, 15 Nov 2021 09:15:13 -0600 Subject: [PATCH] Check if Drupal was located before calling realpath #249 --- src/Command/CheckCommand.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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));