We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7b0a3d0 commit d301115Copy full SHA for d301115
src/think/route/dispatch/Callback.php
@@ -12,6 +12,7 @@
12
13
namespace think\route\dispatch;
14
15
+use think\exception\ClassNotFoundException;
16
use think\route\Dispatch;
17
18
/**
@@ -49,7 +50,12 @@ public function exec()
49
50
->setController($controller)
51
->setAction($action);
52
- $instance = $this->app->invokeClass($class);
53
+ if (class_exists($class)) {
54
+ $instance = $this->app->invokeClass($class);
55
+ } else {
56
+ throw new ClassNotFoundException('class not exists:' . $class, $class);
57
+ }
58
+
59
return $this->responseWithMiddlewarePipeline($instance, $action);
60
}
61
0 commit comments