Fixed fatal error in box controllers if request object is undefined
authorMarcel Werk <burntime@woltlab.com>
Sat, 22 Oct 2016 15:10:08 +0000 (17:10 +0200)
committerMarcel Werk <burntime@woltlab.com>
Sat, 22 Oct 2016 15:10:08 +0000 (17:10 +0200)
wcfsetup/install/files/lib/system/box/ArticleCategoriesBoxController.class.php

index 14d5943dee5a822bb38124525faa5721761c92f6..0ad64d53db33fffdac1dfcfbc2c20331cfedebe1 100644 (file)
@@ -33,9 +33,11 @@ class ArticleCategoriesBoxController extends AbstractBoxController {
                if (iterator_count($categoryList)) {
                        // get active category
                        $activeCategory = null;
-                       if (RequestHandler::getInstance()->getActiveRequest()->getRequestObject() instanceof CategoryArticleListPage || RequestHandler::getInstance()->getActiveRequest()->getRequestObject() instanceof ArticlePage) {
-                               if (RequestHandler::getInstance()->getActiveRequest()->getRequestObject()->category !== null) {
-                                       $activeCategory = RequestHandler::getInstance()->getActiveRequest()->getRequestObject()->category;
+                       if (RequestHandler::getInstance()->getActiveRequest() !== null) {
+                               if (RequestHandler::getInstance()->getActiveRequest()->getRequestObject() instanceof CategoryArticleListPage || RequestHandler::getInstance()->getActiveRequest()->getRequestObject() instanceof ArticlePage) {
+                                       if (RequestHandler::getInstance()->getActiveRequest()->getRequestObject()->category !== null) {
+                                               $activeCategory = RequestHandler::getInstance()->getActiveRequest()->getRequestObject()->category;
+                                       }
                                }
                        }