From a039ebd29a5ebb5fabbf04e860beef59b4b2ddbc Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Tue, 21 Jun 2016 15:19:13 +0200 Subject: [PATCH] Fixed handling of invalid controllers --- wcfsetup/install/files/lib/system/WCF.class.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/wcfsetup/install/files/lib/system/WCF.class.php b/wcfsetup/install/files/lib/system/WCF.class.php index f09fc33e21..1e5f1cefb9 100644 --- a/wcfsetup/install/files/lib/system/WCF.class.php +++ b/wcfsetup/install/files/lib/system/WCF.class.php @@ -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(); } /** -- 2.20.1