Skip to content

Commit

Permalink
Merge pull request #38 from flanksource/fix/nil-object
Browse files Browse the repository at this point in the history
fix: prevent nil dereference on unstructuredobject
  • Loading branch information
moshloop authored Apr 29, 2021
2 parents 981c824 + c2078ed commit 7a09352
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,9 @@ func (c *Client) Apply(namespace string, objects ...runtime.Object) error {

client, _, unstructuredObj, err := c.GetDynamicClientFor(namespace, obj)
if IsAPIResourceMissing(err) {
if unstructuredObj == nil {
return err
}
if err := c.WaitForAPIResource(unstructuredObj.GetAPIVersion(), unstructuredObj.GetKind(), 3*time.Minute); err != nil {
return err
}
Expand Down

0 comments on commit 7a09352

Please # to comment.