Fix `MultiPageCondition::showContent()` when showing `NamedUserException`
authorMatthias Schmidt <gravatronics@live.com>
Sat, 22 Oct 2016 05:48:07 +0000 (07:48 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Sat, 22 Oct 2016 05:48:07 +0000 (07:48 +0200)
wcfsetup/install/files/lib/system/condition/page/MultiPageCondition.class.php

index 6795cc3aaea4e9de1a68e86c9f06edae612955a6..b5c35d2c0c204f3a0d37bb6f1c93df1d66a1c3fe 100644 (file)
@@ -72,9 +72,12 @@ class MultiPageCondition extends AbstractMultiSelectCondition implements IConten
         * @inheritDoc
         */
        public function showContent(Condition $condition) {
-               $pageID = RequestHandler::getInstance()->getActiveRequest()->getPageID();
-               if ($pageID && $condition->pageIDs && is_array($condition->pageIDs)) {
-                       return in_array($pageID, $condition->pageIDs);
+               $activeRequest = RequestHandler::getInstance()->getActiveRequest();
+               if ($activeRequest !== null) {
+                       $pageID = $activeRequest->getPageID();
+                       if ($pageID && $condition->pageIDs && is_array($condition->pageIDs)) {
+                               return in_array($pageID, $condition->pageIDs);
+                       }
                }
                
                return false;