diff --git a/scripts/composer/ScriptHandler.php b/scripts/composer/ScriptHandler.php index 7a473f1b7..a5b8d36be 100644 --- a/scripts/composer/ScriptHandler.php +++ b/scripts/composer/ScriptHandler.php @@ -22,7 +22,10 @@ public static function createRequiredFiles(Event $event) { $drupalFinder = new DrupalFinderComposerRuntime(); $drupalRoot = $drupalFinder->getDrupalRoot(); - // If Drupal root was not found, exit. + if (is_null($drupalRoot)) { + $event->getIO()->writeError('Drupal root could not be detected.'); + exit(1); + } if (is_null($drupalRoot)) { $io = $event->getIO(); $io->writeError(