add null check in FunctionController

This commit is contained in:
markfisher
2017-02-06 15:41:19 -05:00
parent 9a5600f259
commit 2075c649a5

View File

@@ -59,8 +59,11 @@ public class FunctionController {
return debug ? result.log() : result;
}
Consumer<String> consumer = functions.lookupConsumer(name);
body.subscribe(consumer::accept);
return null;
if (consumer != null) {
body.subscribe(consumer::accept);
return null;
}
throw new IllegalArgumentException("no such function: " + name);
}
@GetMapping(path = "/{name}")