diff options
Diffstat (limited to 'lib/public/AppFramework/App.php')
-rw-r--r-- | lib/public/AppFramework/App.php | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/public/AppFramework/App.php b/lib/public/AppFramework/App.php index 06d4b36384f..4cbd1f8d32c 100644 --- a/lib/public/AppFramework/App.php +++ b/lib/public/AppFramework/App.php @@ -41,6 +41,7 @@ declare(strict_types=1); namespace OCP\AppFramework; use OC\AppFramework\Routing\RouteConfig; +use OC\Route\Router; use OC\ServerContainer; use OCP\Route\IRouter; @@ -146,6 +147,10 @@ class App { * @deprecated 20.0.0 Just return an array from your routes.php */ public function registerRoutes(IRouter $router, array $routes) { + if (!($router instanceof Router)) { + throw new \RuntimeException('Can only setup routes with real router'); + } + $routeConfig = new RouteConfig($this->container, $router, $routes); $routeConfig->register(); } |