Skip to content

Commit

Permalink
Add a nil check for the calculated instanceDiff while Observe
Browse files Browse the repository at this point in the history
Signed-off-by: Sergen Yalçın <[email protected]>
  • Loading branch information
sergenyalcin committed Jan 9, 2024
1 parent b20afd6 commit 58b94f0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/controller/external_nofork.go
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,9 @@ func (n *noForkExternal) Observe(ctx context.Context, mg xpresource.Managed) (ma
if err != nil {
return managed.ExternalObservation{}, errors.Wrap(err, "cannot compute the instance diff")
}
if instanceDiff == nil {
instanceDiff = tf.NewInstanceDiff()
}
n.instanceDiff = instanceDiff
noDiff := instanceDiff.Empty()

Expand Down

0 comments on commit 58b94f0

Please sign in to comment.