Skip to content

Commit da4a639

Browse files
committed
[toolkit] add exception, when toolbox is not registered
1 parent 3fe435d commit da4a639

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

library/toolkit/Toolkit.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,13 @@ public function getToolbox($toolboxName)
114114
return $this->toolboxes[$toolboxName];
115115
}
116116

117+
if (!$this->hasToolbox($toolboxName)) {
118+
throw new RuntimeException($this->translate(
119+
'Toolbox "{name}" is not registered.',
120+
['name' => $toolboxName]
121+
));
122+
}
123+
117124
$options = $this->getToolboxSettings($toolboxName);
118125
$toolboxClass = $this->registeredToolboxes[$toolboxName];
119126

0 commit comments

Comments
 (0)