X-Git-Url: https://git.mxchange.org/?p=core.git;a=blobdiff_plain;f=inc%2Fclasses%2Fmain%2Fcontroller%2Fclass_BaseController.php;h=95827c5e89eeb3ce87638972f9994ff6433e8471;hp=2a1c50f97c0b5a18267c4bd067f8b1d9287941df;hb=7274fc15fc62c08232a7fad492f445306d17cb3c;hpb=90e103cb445f53c4ebd18c3f43dff51cbf0aae73 diff --git a/inc/classes/main/controller/class_BaseController.php b/inc/classes/main/controller/class_BaseController.php index 2a1c50f9..95827c5e 100644 --- a/inc/classes/main/controller/class_BaseController.php +++ b/inc/classes/main/controller/class_BaseController.php @@ -70,8 +70,16 @@ class BaseController extends BaseFrameworkSystem implements Registerable { * @param $filterGroup Group of the filter * @param $filterInstance An instance of a filter * @return void + * @throws InvalidFilterChainException If the filter chain is invalid */ protected function addFilter ($filterGroup, Filterable $filterInstance) { + // Test if the filter is there + if (!isset($this->filterChains[$filterGroup])) { + // Throw an exception here + throw new InvalidFilterChainException(array($this, $filterGroup), self::EXCEPTION_FILTER_CHAIN_INVALID); + } // END - if + + // Add the filter $this->filterChains[$filterGroup]->addFilter($filterInstance); }