Encryption: Re-order error check (#52251)

This commit is contained in:
Joan López de la Franca Beltran 2022-07-14 23:53:43 +02:00 committed by GitHub
parent 41790083d2
commit 973b3112d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -38,14 +38,14 @@ func (ss *SecretsStoreImpl) GetDataKey(ctx context.Context, id string) (*secrets
return err
})
if !exists {
return nil, secrets.ErrDataKeyNotFound
}
if err != nil {
return nil, fmt.Errorf("failed getting data key: %w", err)
}
if !exists {
return nil, secrets.ErrDataKeyNotFound
}
return dataKey, nil
}