Fixed handling of invalid controllers
authorAlexander Ebert <ebert@woltlab.com>
Tue, 21 Jun 2016 13:19:13 +0000 (15:19 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 21 Jun 2016 13:19:13 +0000 (15:19 +0200)
wcfsetup/install/files/lib/system/WCF.class.php

index f09fc33e21dd088a59cf3b219ad94a3f5657fda3..1e5f1cefb9a336c371fb34a00167d1fff1bf20ef 100644 (file)
@@ -812,6 +812,10 @@ class WCF {
         * @return Page|null
         */
        public static function getActivePage() {
+               if (self::getActiveRequest() === null) {
+                       return null;
+               }
+               
                if (self::getActiveRequest()->getClassName() === CmsPage::class) {
                        $metaData = self::getActiveRequest()->getMetaData();
                        return PageCache::getInstance()->getPage($metaData['cms']['pageID']);
@@ -954,7 +958,11 @@ class WCF {
         * @return      boolean
         */
        public static function isLandingPage() {
-               return RequestHandler::getInstance()->getActiveRequest()->isLandingPage();
+               if (self::getActiveRequest() === null) {
+                       return false;
+               }
+               
+               return self::getActiveRequest()->isLandingPage();
        }
        
        /**