Fix issue when uninstalling applications

This prevents a call to a member function `getPrimaryController()` on a non-object in `Route.class.php` and allows uninstallation of applications again.