Skip to content

Commit

Permalink
fix: [CDS-104598]: Add check for panic when OPA policy is denied (#1129)
Browse files Browse the repository at this point in the history
Co-authored-by: Ritek <[email protected]>
  • Loading branch information
harshitsrivastava97 and ritek01 authored Dec 4, 2024
1 parent a3c792c commit 6f0dca4
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ func resourceConnectorCreateOrUpdateBase(ctx context.Context, d *schema.Resource
return nil, helpers.HandleApiError(err, d, httpResp)
}

if resp.Data.Connector == nil {
return nil, diag.FromErr(fmt.Errorf("Could not create/update connector. Please check the policy restrictions."))
}

readCommonConnectorData(d, resp.Data.Connector)

return resp.Data.Connector, nil
Expand Down

0 comments on commit 6f0dca4

Please sign in to comment.