Skip to content
This repository was archived by the owner on Oct 14, 2020. It is now read-only.

Commit 23f17d2

Browse files
committed
Check if job is set to hopefully fix potential null pointer exception
1 parent 359b8d8 commit 23f17d2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

operator/controllers/execution/scan_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ func (r *ScanReconciler) checkIfJobIsCompleted(name, namespace string) (bool, er
145145
if err != nil {
146146
return false, err
147147
}
148-
return (job.Status.Succeeded != 0), nil
148+
return (job != nil && job.Status.Succeeded != 0), nil
149149
}
150150

151151
func (r *ScanReconciler) startScan(scan *executionv1.Scan) error {

0 commit comments

Comments
 (0)