Skip to content

Commit d301115

Browse files
committed
修正
1 parent 7b0a3d0 commit d301115

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/think/route/dispatch/Callback.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
namespace think\route\dispatch;
1414

15+
use think\exception\ClassNotFoundException;
1516
use think\route\Dispatch;
1617

1718
/**
@@ -49,7 +50,12 @@ public function exec()
4950
->setController($controller)
5051
->setAction($action);
5152

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+
5359
return $this->responseWithMiddlewarePipeline($instance, $action);
5460
}
5561

0 commit comments

Comments
 (0)