From 4acee5089cae5c3fe6d622ffca9f74fd40b5c8f7 Mon Sep 17 00:00:00 2001 From: Belle Aerni Date: Tue, 15 Nov 2022 21:18:08 -0800 Subject: [PATCH] Be descriptive if module folder doesn't match expected --- src/bb-library/Box/Mod.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/bb-library/Box/Mod.php b/src/bb-library/Box/Mod.php index 9147fdd81..91805a559 100644 --- a/src/bb-library/Box/Mod.php +++ b/src/bb-library/Box/Mod.php @@ -301,6 +301,11 @@ class Box_Mod private function _getModPath() { - return BB_PATH_MODS . DIRECTORY_SEPARATOR . ucfirst($this->mod) . DIRECTORY_SEPARATOR; + $modPath = BB_PATH_MODS . DIRECTORY_SEPARATOR . ucfirst($this->mod) . DIRECTORY_SEPARATOR; + if(is_dir($modPath)){ + return $modPath; + }else{ + throw new Box_Exception("Error: module $this->mod path appears to be invalid. Please ensure the module folder is named " . ucfirst($this->mod)); + } } }