We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents dcd0dbc + 9c5975d commit b9e0483Copy full SHA for b9e0483
lib/internal/Magento/Framework/Module/Dir.php
@@ -45,6 +45,12 @@ public function getDir($moduleName, $type = '')
45
{
46
$path = $this->componentRegistrar->getPath(ComponentRegistrar::MODULE, $moduleName);
47
48
+ // An empty $type means it's getting the directory of the module itself.
49
+ if (empty($type) && !isset($path)) {
50
+ // Note: do not throw \LogicException, as it would break backwards-compatibility.
51
+ throw new \InvalidArgumentException("Module '$moduleName' is not correctly registered.");
52
+ }
53
+
54
if ($type) {
55
if (!in_array($type, [
56
self::MODULE_ETC_DIR,
0 commit comments