Skip to content

Commit

Permalink
修正
Browse files Browse the repository at this point in the history
  • Loading branch information
liu21st committed Nov 26, 2024
1 parent 7b0a3d0 commit d301115
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/think/route/dispatch/Callback.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

namespace think\route\dispatch;

use think\exception\ClassNotFoundException;
use think\route\Dispatch;

/**
Expand Down Expand Up @@ -49,7 +50,12 @@ public function exec()
->setController($controller)
->setAction($action);

$instance = $this->app->invokeClass($class);
if (class_exists($class)) {
$instance = $this->app->invokeClass($class);
} else {
throw new ClassNotFoundException('class not exists:' . $class, $class);
}

return $this->responseWithMiddlewarePipeline($instance, $action);
}

Expand Down

0 comments on commit d301115

Please sign in to comment.