Skip to content

Commit

Permalink
Return error when client does not exist (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
gmichels authored Mar 6, 2023
1 parent 98ccd39 commit 11bd5e9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions adguard/client_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,12 @@ func (r *clientResource) Read(ctx context.Context, req resource.ReadRequest, res
"Could not read AdGuard Home client ID "+state.ID.ValueString()+": "+err.Error(),
)
return
} else if client == nil {
resp.Diagnostics.AddError(
"Error Reading AdGuard Home Client",
"No such AdGuard Home client with ID "+state.ID.ValueString(),
)
return
}

// overwrite client with refreshed state
Expand Down

0 comments on commit 11bd5e9

Please sign in to comment.