Minor fix to avoid NPE when output content type is not present

This commit is contained in:
Oleg Zhurakousky
2020-01-15 07:01:18 +01:00
parent 5c84b100d8
commit 2a8c3cdda6

View File

@@ -120,6 +120,7 @@ public class BeanFactoryAwareFunctionRegistry
this.applicationContext.getBeanNamesForType(Consumer.class).length;
}
@Override
@SuppressWarnings("unchecked")
public <T> T lookup(String definition, String... acceptedOutputTypes) {
Object function = this.proxyInvokerIfNecessary((FunctionInvocationWrapper) this.compose(null, definition, acceptedOutputTypes));
@@ -625,7 +626,7 @@ public class BeanFactoryAwareFunctionRegistry
.filter(v -> v != null)
.findFirst().orElse(null);
}
return convertedValue;
return convertedValue != null ? convertedValue : value;
}