fix NullPointException cause by empty result of skipped request #409
This commit is contained in:
@@ -216,6 +216,9 @@ public class Pipeline {
|
||||
List<Mono> monos = step.run();
|
||||
Mono<Map>[] monoArray = monos.stream().toArray(Mono[]::new);
|
||||
Mono<StepResponse>result = Flux.merge(monoArray).reduce(new HashMap(), (item1, item2) -> {
|
||||
if (item2.isEmpty()) {
|
||||
return item1;
|
||||
}
|
||||
Input input = (Input)item2.get("request");
|
||||
item1.put(input.getName() , item2.get("data"));
|
||||
return item1;
|
||||
|
||||
@@ -132,7 +132,10 @@ public class Step {
|
||||
if (input.needRun(ctx)) {
|
||||
return input.run();
|
||||
}
|
||||
return Mono.just(new HashMap());
|
||||
Map<String, Object> inputResult = new HashMap<String, Object>();
|
||||
inputResult.put("data", new HashMap<String, Object>());
|
||||
inputResult.put("request", input);
|
||||
return Mono.just(inputResult);
|
||||
}).flatMap(r -> {
|
||||
if (r instanceof ComponentResult) {
|
||||
Map<String, Object> inputResult = new HashMap<String, Object>();
|
||||
|
||||
Reference in New Issue
Block a user