From: Alexander Ebert Date: Tue, 21 Jun 2016 13:19:13 +0000 (+0200) Subject: Fixed handling of invalid controllers X-Git-Tag: 3.0.0_Beta_1~1381 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a039ebd29a5ebb5fabbf04e860beef59b4b2ddbc;p=GitHub%2FWoltLab%2FWCF.git Fixed handling of invalid controllers --- 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(); } /**