Skip to content

Commit 54f214f

Browse files
committed
add detect
1 parent d59b177 commit 54f214f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

platform-api/src/main/java/com/flow/platform/api/service/job/JobSearchServiceImpl.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public List<Job> match(SearchCondition searchCondition, List<Job> jobs) {
8282
for (Job job : jobs) {
8383
if (job.getNumber().toString().equals(words)) { // compare job number
8484
copyJobs.add(job);
85-
} else if (words.equals(
85+
} else if (job.getRootResult() != null && words.equals(
8686
job.getRootResult().getOutputs().get(GitEnvs.FLOW_GIT_BRANCH.toString()))) { //compare branch
8787
copyJobs.add(job);
8888
}
@@ -105,7 +105,8 @@ public List<Job> match(SearchCondition searchCondition, List<Job> jobs) {
105105

106106
List<Job> copyJobs = new LinkedList<>();
107107
for (Job job : jobs) {
108-
if (branch.equals(job.getRootResult().getOutputs().get(GitEnvs.FLOW_GIT_BRANCH.toString()))) {
108+
if (job.getRootResult() != null && branch
109+
.equals(job.getRootResult().getOutputs().get(GitEnvs.FLOW_GIT_BRANCH.toString()))) {
109110
copyJobs.add(job);
110111
}
111112
}

0 commit comments

Comments
 (0)