diff --git a/controllers/awsadapterconfig_controller.go b/controllers/awsadapterconfig_controller.go index b9bf2f2..05fa6b7 100644 --- a/controllers/awsadapterconfig_controller.go +++ b/controllers/awsadapterconfig_controller.go @@ -107,8 +107,8 @@ func (r *AWSAdapterConfigReconciler) Reconcile(ctx context.Context, req ctrl.Req clusterFound := false callerIdentity, err := stsClient.GetCallerIdentity(ctx, &sts.GetCallerIdentityInput{}) - if err != nil || callerIdentity.Account == nil { - if callerIdentity.Account == nil { + if err != nil || callerIdentity == nil || callerIdentity.Account == nil { + if callerIdentity == nil || callerIdentity.Account == nil { err = fmt.Errorf("callerIdentity nil") }