diff --git a/src/DrupalFinderComposerRuntime.php b/src/DrupalFinderComposerRuntime.php index 238561e..baf927b 100644 --- a/src/DrupalFinderComposerRuntime.php +++ b/src/DrupalFinderComposerRuntime.php @@ -17,8 +17,12 @@ class DrupalFinderComposerRuntime */ public function getDrupalRoot(): ?string { - $core = InstalledVersions::getInstallPath('drupal/core'); - return $core ? realpath(dirname($core)) : null; + try { + $core = InstalledVersions::getInstallPath('drupal/core'); + return $core ? realpath(dirname($core)) : null; + } catch (\OutOfBoundsException) { + return null; + } } /**