diff --git a/pkg/orchestrator/scanestimationwatcher/watcher.go b/pkg/orchestrator/scanestimationwatcher/watcher.go index 0bd8865749..5243b9dd6a 100644 --- a/pkg/orchestrator/scanestimationwatcher/watcher.go +++ b/pkg/orchestrator/scanestimationwatcher/watcher.go @@ -526,6 +526,18 @@ func updateTotalScanTimeWithParallelScans(scanEstimation *models.ScanEstimation) return fmt.Errorf("empty scan template") } + if scanEstimation.Summary == nil { + return fmt.Errorf("empty summary") + } + + if scanEstimation.Summary.JobsCompleted == nil { + return fmt.Errorf("jobsCompleted is not set") + } + + if *scanEstimation.Summary.JobsCompleted == 0 { + return fmt.Errorf("0 completed jobs in summary") + } + maxParallelScanners := utils.ValueOrZero(scanEstimation.ScanTemplate.MaxParallelScanners) if maxParallelScanners > 1 {