diff --git a/XForm/CxOneTransformer/Transformer.cs b/XForm/CxOneTransformer/Transformer.cs index 5dd072f1..8d011d93 100644 --- a/XForm/CxOneTransformer/Transformer.cs +++ b/XForm/CxOneTransformer/Transformer.cs @@ -288,18 +288,23 @@ private void OutputScaScanResults(IOutputTransaction scanTrx, ProjectDescriptor { using (var detailed_report = CxScanResults.GetScaScanResults(Context, ThreadOpts.CancellationToken, scan.ScanId)) { - var flat_summary = new SortedDictionary(); - AddScanHeaderElements(scan, flat_summary); - AddCommonScanFields(scan, scanHeaders, flat_summary); - AddPairsAsTags(scanHeaders[scan.ScanId].Tags, flat_summary); - ScaTransformer.Transformer.FillScanSummaryData(detailed_report.Result, flat_summary, scan.Project.ProjectName); - scanTrx.write(ScaScanSummaryOut, flat_summary); - - var detail_header = new SortedDictionary(); - AddScanHeaderElements(scan, detail_header); - AddCommonScanFields(scan, scanHeaders, detail_header); - foreach (var flat_details in ScaTransformer.Transformer.GenerateScanDetailData(detailed_report.Result, detail_header, scan, riskStates)) - scanTrx.write(ScaScanDetailOut, flat_details); + if (detailed_report.Result != null) + { + var flat_summary = new SortedDictionary(); + AddScanHeaderElements(scan, flat_summary); + AddCommonScanFields(scan, scanHeaders, flat_summary); + AddPairsAsTags(scanHeaders[scan.ScanId].Tags, flat_summary); + ScaTransformer.Transformer.FillScanSummaryData(detailed_report.Result, flat_summary, scan.Project.ProjectName); + scanTrx.write(ScaScanSummaryOut, flat_summary); + + var detail_header = new SortedDictionary(); + AddScanHeaderElements(scan, detail_header); + AddCommonScanFields(scan, scanHeaders, detail_header); + foreach (var flat_details in ScaTransformer.Transformer.GenerateScanDetailData(detailed_report.Result, detail_header, scan, riskStates)) + scanTrx.write(ScaScanDetailOut, flat_details); + } + else + _log.Warn($"Project {project.ProjectId}:{project.ProjectName} - SCA results for scan {scan.ScanId} are not available."); } }