handle the case when scan job does not exist

This commit is contained in:
Tan Jiang 2017-06-15 14:28:45 +08:00
parent f016dd113c
commit 0b145771c5

View File

@ -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 {