Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions lib/internal/Magento/Framework/Module/Dir.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ public function getDir($moduleName, $type = '')
{
$path = $this->componentRegistrar->getPath(ComponentRegistrar::MODULE, $moduleName);

// An empty $type means it's getting the directory of the module itself.
if (empty($type) && !isset($path)) {
// Note: do not throw \LogicException, as it would break backwards-compatibility.
throw new \InvalidArgumentException("Module '$moduleName' is not correctly registered.");
}

if ($type) {
if (!in_array($type, [
self::MODULE_ETC_DIR,
Expand Down