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