mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-23 00:57:44 +01:00
handle the case when scan job does not exist
This commit is contained in:
parent
f016dd113c
commit
0b145771c5
@ -653,6 +653,9 @@ func getScanOverview(digest string, tag string) *models.ImgScanOverview {
|
||||
if err != nil {
|
||||
log.Errorf("Failed to get scan job for id:%d, error: %v", data.JobID, err)
|
||||
return nil
|
||||
} else if job == nil { //job does not exist
|
||||
log.Errorf("The scan job with id: %d does not exist, returning nil", data.JobID)
|
||||
return nil
|
||||
}
|
||||
data.Status = job.Status
|
||||
if data.Status != models.JobFinished {
|
||||
|
Loading…
Reference in New Issue
Block a user