Skip to content

Commit fb3a200

Browse files
authored
Merge pull request #324 from sergenyalcin/fix-nil-instance-diff
Add a nil check for the calculated instanceDiff while Observe
2 parents b20afd6 + 58b94f0 commit fb3a200

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pkg/controller/external_nofork.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,9 @@ func (n *noForkExternal) Observe(ctx context.Context, mg xpresource.Managed) (ma
495495
if err != nil {
496496
return managed.ExternalObservation{}, errors.Wrap(err, "cannot compute the instance diff")
497497
}
498+
if instanceDiff == nil {
499+
instanceDiff = tf.NewInstanceDiff()
500+
}
498501
n.instanceDiff = instanceDiff
499502
noDiff := instanceDiff.Empty()
500503

0 commit comments

Comments
 (0)