avoid Supplier NPE

This commit is contained in:
markfisher
2017-03-13 13:38:37 -04:00
parent da013c1015
commit 98c2ca76f5

View File

@@ -76,6 +76,9 @@ public class FunctionController {
@SuppressWarnings({ "unchecked", "rawtypes" })
public Flux<String> supplier(@PathVariable String name) {
Supplier<Object> supplier = functions.lookupSupplier(name);
if (supplier == null) {
throw new IllegalArgumentException("no such supplier: " + name);
}
if (!FunctionUtils.isFluxSupplier(supplier)) {
supplier = new FluxSupplier(supplier);
}