From 34df82171220f3169c7644909c0e0418525a94f9 Mon Sep 17 00:00:00 2001 From: codebymikey <9484406+codebymikey@users.noreply.github.com> Date: Mon, 14 Jul 2025 10:08:26 +0100 Subject: [PATCH] Add error handler if drupal/core is not installed --- src/DrupalFinderComposerRuntime.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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; + } } /**