From 87961df0cb1c524f58af754c58f3309a671a3c36 Mon Sep 17 00:00:00 2001 From: Nathan Leach Date: Tue, 25 Oct 2022 13:45:35 -0500 Subject: [PATCH] stabilizing --- XForm/CxOneTransformer/Transformer.cs | 29 ++++++++++++++++----------- 1 file changed, 17 insertions(+), 12 deletions(-) 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."); } }