Skip to content

Commit

Permalink
add error check
Browse files Browse the repository at this point in the history
  • Loading branch information
chuyich committed Dec 19, 2023
1 parent 8d34217 commit b084bd2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/provider/protocols_cifs_local_group_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@ func (r *CifsLocalGroupResource) Read(ctx context.Context, req resource.ReadRequ
var restInfo *interfaces.CifsLocalGroupGetDataModelONTAP
if data.ID.IsNull() {
restInfo, err = interfaces.GetCifsLocalGroupByName(errorHandler, *client, data.Name.ValueString(), data.SVMName.ValueString())
if restInfo == nil || err != nil {
// error reporting done inside GetCifsLocalGroup
return
}
data.ID = types.StringValue(restInfo.SID)
} else {
restInfo, err = interfaces.GetCifsLocalGroup(errorHandler, *client, svm.UUID, data.ID.ValueString())
Expand Down

0 comments on commit b084bd2

Please sign in to comment.