Skip to content

Commit 7389b15

Browse files
committed
Check if Drupal was located before calling realpath
#249
1 parent b08ba99 commit 7389b15

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Diff for: src/Command/CheckCommand.php

+4-3
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,10 @@ protected function execute(InputInterface $input, OutputInterface $output): int
107107
}
108108
}
109109

110-
$drupalFinder->locateRoot($drupalRootCandidate);
111-
$this->drupalRoot = realpath($drupalFinder->getDrupalRoot());
112-
$this->vendorRoot = realpath($drupalFinder->getVendorDir());
110+
if ($drupalFinder->locateRoot($drupalRootCandidate)) {
111+
$this->drupalRoot = realpath($drupalFinder->getDrupalRoot());
112+
$this->vendorRoot = realpath($drupalFinder->getVendorDir());
113+
}
113114

114115
if (!$this->drupalRoot) {
115116
$output->writeln(sprintf('<error>Unable to locate the Drupal root in %s</error>', $drupalRootCandidate));

0 commit comments

Comments
 (0)