GH-640 Fix NPE with non-Message json conversion

Resolves #640

Added test
This commit is contained in:
Oleg Zhurakousky
2021-02-05 16:03:45 +01:00
parent 315ed4612d
commit c4dfffe0ba
2 changed files with 27 additions and 3 deletions

View File

@@ -1001,10 +1001,10 @@ public class SimpleFunctionRegistry implements FunctionRegistry, FunctionInspect
&& SimpleFunctionRegistry.this.conversionService.canConvert(input.getClass(), rawInputType)) {
convertedInput = SimpleFunctionRegistry.this.conversionService.convert(input, rawInputType);
}
if (convertedInput == null && input.getClass().isAssignableFrom(rawInputType)) {
convertedInput = input;
if (convertedInput == null && logger.isDebugEnabled()) {
logger.debug("Failed to convert input '" + input + "' to type " + inputType + ". Will use it as is.");
}
return convertedInput;
return convertedInput == null ? input : convertedInput;
}
/*