Skip to content

Commit

Permalink
Fix NPE
Browse files Browse the repository at this point in the history
Signed-off-by: Tamal Saha <[email protected]>
  • Loading branch information
tamalsaha committed Aug 16, 2023
1 parent 973a879 commit e1615ce
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/controllers/scanrequest/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ func (r *RequestReconciler) updateStatusWithImageDetails(vis trivy.ImageVisibili

_, err = cu.PatchStatus(r.ctx, r.Client, r.req, func(obj client.Object) client.Object {
in := obj.(*api.ImageScanRequest)
if in.Status.Image == nil {
in.Status.Image = new(trivy.ImageDetails)
}
in.Status.Image.Visibility = vis
in.Status.Image.Name = img.Name
in.Status.Image.Tag = img.Tag
Expand Down

0 comments on commit e1615ce

Please sign in to comment.