Method execution should not error without value

- Do npe check when getting class type out from
  incoming value.
- Fix #572
This commit is contained in:
Janne Valkealahti
2022-11-22 07:47:52 +00:00
parent ee7a9da4aa
commit 61ae11bf94
2 changed files with 23 additions and 1 deletions

View File

@@ -183,8 +183,10 @@ public interface CommandExecution {
if (parameterName == null) {
return false;
}
Class<?> sourceType = paramValues.get(parameterName) != null ? paramValues.get(parameterName).getClass()
: null;
return paramValues.containsKey(parameterName) && conversionService
.canConvert(paramValues.get(parameterName).getClass(), parameter.getParameterType());
.canConvert(sourceType, parameter.getParameterType());
}
@Override