Skip to content

Commit 5ba0e68

Browse files
added Null check for branch status
1 parent 55920dd commit 5ba0e68

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/main/java/com/checkmarx/sdk/service/CxService.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,9 @@ public ScanResults getReportContent(Integer reportId, FilterConfiguration filter
668668
if (cxProperties.getCxBranch() && cxProperties.getRestrictResultsToBranch() != null && cxProperties.getRestrictResultsToBranch()) {
669669
if(cxProperties.getProjectSummary()!=null && cxProperties.getProjectSummary()){
670670
CxProjectBranchingStatus branch = getProjectBranchingStatus(Integer.valueOf(cxResults.getProjectId()));
671-
projectSummary = getScanSummary(branch.getOriginalProjectId());
671+
if(branch!=null){
672+
projectSummary = getScanSummary(branch.getOriginalProjectId());
673+
}
672674
}
673675
scanSummary = new CxScanSummary(summary);
674676
} else {
@@ -881,7 +883,9 @@ public ScanResults getReportContent(File file, FilterConfiguration filter) throw
881883
if (cxProperties.getCxBranch() && cxProperties.getRestrictResultsToBranch() != null && cxProperties.getRestrictResultsToBranch()) {
882884
if(cxProperties.getProjectSummary()!=null && cxProperties.getProjectSummary()){
883885
CxProjectBranchingStatus branch = getProjectBranchingStatus(Integer.valueOf(cxResults.getProjectId()));
884-
projectSummary = getScanSummary(branch.getOriginalProjectId());
886+
if(branch!=null){
887+
projectSummary = getScanSummary(branch.getOriginalProjectId());
888+
}
885889
}
886890
scanSummary = new CxScanSummary(summary);
887891
} else {

0 commit comments

Comments
 (0)