Skip to content

Commit 80dbab6

Browse files
committed
bug fixes
1 parent 09ff8f8 commit 80dbab6

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

Libs/Executive/ExecuteLoop.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ public class ExecuteLoop : ExecuteOnce
3939
}
4040

4141

42+
GC.Collect();
43+
4244
Task.Delay(Service.ProcessPeriodMinutes * 60 * 1000, t.Token).Wait();
4345
} while (!t.Token.IsCancellationRequested);
4446

XForm/CxOneTransformer/Transformer.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,12 @@ public override void DoTransform(CancellationToken token)
164164

165165
Parallel.ForEach(State.Projects, ThreadOpts, (projDescriptor) =>
166166
{
167+
if (!lastScansTask.Result.ContainsKey(projDescriptor.ProjectId))
168+
{
169+
_log.Info($"Project {projDescriptor.ProjectId}:{projDescriptor.TeamName}:{projDescriptor.ProjectName} contains no scans.");
170+
return;
171+
}
172+
167173
var latestScanDateForProject = lastScansTask.Result[projDescriptor.ProjectId].Completed;
168174

169175
// This skips some API I/O since we know the last scan date of some projects.
@@ -334,7 +340,10 @@ private void OutputSastScanResults(IOutputTransaction scanTrx, ProjectDescriptor
334340
flat_details.Add("State", detail_entry.State);
335341
flat_details.Add("Status", detail_entry.Status);
336342
flat_details.Add("QueryCweId", detail_entry.VulnerabilityDetails.CweId);
337-
flat_details.Add("QueryCategories", String.Join(",", detail_entry.VulnerabilityDetails.Categories));
343+
344+
if (detail_entry.VulnerabilityDetails.Categories != null)
345+
flat_details.Add("QueryCategories", String.Join(",", detail_entry.VulnerabilityDetails.Categories));
346+
338347
flat_details.Add("FalsePositive", detail_entry.State.CompareTo(NE_VALUE) == 0);
339348
flat_details.Add("Branch", scanHeaders[scan.ScanId].Branch);
340349
flat_details.Add("ScanFinished", scanHeaders[scan.ScanId].Updated);

0 commit comments

Comments
 (0)