Skip to content

Commit 1e8e825

Browse files
committed
Fix #27523: throw informative error if the requested module does not exist
1 parent b307274 commit 1e8e825

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

app/code/Magento/Developer/Console/Command/GeneratePatchCommand.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int
133133
}
134134
$type = $input->getOption(self::INPUT_KEY_PATCH_TYPE);
135135
$modulePath = $this->componentRegistrar->getPath(ComponentRegistrar::MODULE, $moduleName);
136+
if (null === $modulePath) {
137+
throw new \InvalidArgumentException(sprintf('Cannot find a registered module with name "%s"', $moduleName));
138+
}
136139
$preparedModuleName = str_replace('_', '\\', $moduleName);
137140
$preparedType = ucfirst($type);
138141
$patchInterface = sprintf('%sPatchInterface', $preparedType);

0 commit comments

Comments
 (0)