mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-23 14:40:00 +00:00
Allow resolution of optional HandlerMethod
Closes gh-35067
This commit is contained in:
+4
@@ -217,6 +217,10 @@ public class InvocableHandlerMethod extends HandlerMethod {
|
||||
if (args[i] != null) {
|
||||
continue;
|
||||
}
|
||||
if (parameter.getParameterType().equals(HandlerMethod.class) && parameter.isOptional()) {
|
||||
args[i] = null;
|
||||
continue;
|
||||
}
|
||||
if (!this.resolvers.supportsParameter(parameter)) {
|
||||
throw new IllegalStateException(formatArgumentError(parameter, "No suitable resolver"));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user