Skip to content

Commit

Permalink
[refactor] Check for a nil lastTime before use
Browse files Browse the repository at this point in the history
Signed-off-by: Luke Mallon (Nalum) <luke@mallon.ie>
  • Loading branch information
Nalum committed Dec 17, 2021
1 parent b19e3e9 commit 263910f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion controllers/imageupdateautomation_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ func (r *ImageUpdateAutomationReconciler) Reconcile(ctx context.Context, req ctr
if err == errNoChanges {
debuglog.Info("no changes made in working directory; no commit")
statusMessage = "no updates made"
if lastCommit, lastTime := auto.Status.LastPushCommit, auto.Status.LastPushTime; lastCommit != "" {
if lastCommit, lastTime := auto.Status.LastPushCommit, auto.Status.LastPushTime; lastCommit != "" && lastTime != nil {
statusMessage = fmt.Sprintf("%s; last commit %s at %s", statusMessage, lastCommit[:7], lastTime.Format(time.RFC3339))
}
} else {
Expand Down

0 comments on commit 263910f

Please sign in to comment.