Skip to content

Commit

Permalink
fix: nil pointer exception when account not found (#69)
Browse files Browse the repository at this point in the history
Signed-off-by: Kushal Beniwal <[email protected]>
Co-authored-by: Parikshit Samant <[email protected]>
  • Loading branch information
kbeniwal and pns-nirmata authored Mar 23, 2023
1 parent c97686c commit 4b87541
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions controllers/awsadapterconfig_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,9 @@ func (r *AWSAdapterConfigReconciler) Reconcile(ctx context.Context, req ctrl.Req
*callerIdentity.Account,
},
})
if err != nil || len(x.Accounts) == 0 {
if len(x.Accounts) == 0 {
err = fmt.Errorf("empty Accounts array")
if err != nil || x == nil || len(x.Accounts) == 0 {
if err == nil {
err = fmt.Errorf("no data found for the requested query, inspector2:BatchGetAccountStatus")
}

msg := "error occurred while fetching inspector data"
Expand Down

0 comments on commit 4b87541

Please sign in to comment.