Added work-around for WCF upgrade
authorAlexander Ebert <ebert@woltlab.com>
Sun, 1 Jan 2017 11:13:28 +0000 (12:13 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Sun, 1 Jan 2017 11:13:28 +0000 (12:13 +0100)
wcfsetup/install/files/lib/system/cache/builder/RoutingCacheBuilder.class.php

index b2e4b93eea39ec115278fa4a28c6578963d7199b..cfc77ef7ae9ef58ce5e4d37402dc76e2e45225ee 100644 (file)
@@ -1,5 +1,6 @@
 <?php
 namespace wcf\system\cache\builder;
+use wcf\acp\page\ArticleListPage;
 use wcf\data\application\Application;
 use wcf\data\page\PageCache;
 use wcf\page\CmsPage;
@@ -238,7 +239,11 @@ class RoutingCacheBuilder extends AbstractCacheBuilder {
                        if ($application->packageID == 1) {
                                // handle WCF
                                $page = PageCacheBuilder::getInstance()->getData([], 'landingPage');
-                               if ($page->controller) {
+                               if ($page === null) {
+                                       // invalid cache data, e.g. during upgrade 2.1 -> 3.0
+                                       $controller = ArticleListPage::class;
+                               }
+                               else if ($page->controller) {
                                        $controller = $page->controller;
                                }
                                else {