summaryrefslogtreecommitdiff
path: root/app/Core/Router.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Core/Router.php')
-rw-r--r--app/Core/Router.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/Core/Router.php b/app/Core/Router.php
index f4453c71..843f5139 100644
--- a/app/Core/Router.php
+++ b/app/Core/Router.php
@@ -2,6 +2,8 @@
namespace Kanboard\Core;
+use RuntimeException;
+
/**
* Router class
*
@@ -216,6 +218,10 @@ class Router extends Base
$class = '\Kanboard\\';
$class .= empty($plugin) ? 'Controller\\'.ucfirst($this->controller) : 'Plugin\\'.ucfirst($plugin).'\Controller\\'.ucfirst($this->controller);
+ if (! class_exists($class) || ! method_exists($class, $this->action)) {
+ throw new RuntimeException('Controller or method not found for the given url!');
+ }
+
$instance = new $class($this->container);
$instance->beforeAction($this->controller, $this->action);
$instance->{$this->action}();