Fix issue when uninstalling applications
authorMaximilian Mader <max@bastelstu.be>
Tue, 16 Dec 2014 20:03:52 +0000 (21:03 +0100)
committerMaximilian Mader <max@bastelstu.be>
Tue, 16 Dec 2014 20:03:52 +0000 (21:03 +0100)
This prevents a call to a member function getPrimaryController() on a non-object in Route.class.php and allows uninstallation of applications again.

wcfsetup/install/files/lib/system/request/Route.class.php

index 645e676d47833380500b72d7bf87007199d31cc5..3b529626b8e615adf17194d1f3527192656f3ab6 100644 (file)
@@ -361,7 +361,14 @@ class Route {
                        self::$defaultControllers = array();
                        
                        foreach (ApplicationHandler::getInstance()->getApplications() as $application) {
-                               $controller = WCF::getApplicationObject($application)->getPrimaryController();
+                               $app = WCF::getApplicationObject($application);
+                               
+                               if (!$app) {
+                                       continue;
+                               }
+                               
+                               $controller = $app->getPrimaryController();
+                               
                                if (!$controller) {
                                        continue;
                                }