mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
check for a nil diff in simpleDiff
This commit is contained in:
parent
c7df8bef39
commit
d50a152f8b
@ -320,6 +320,11 @@ func (r *Resource) simpleDiff(
|
|||||||
return instanceDiff, err
|
return instanceDiff, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if instanceDiff == nil {
|
||||||
|
log.Printf("[DEBUG] Instance Diff is nil in SimpleDiff()")
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
// Make sure the old value is set in each of the instance diffs.
|
// Make sure the old value is set in each of the instance diffs.
|
||||||
// This was done by the RequiresNew logic in the full legacy Diff.
|
// This was done by the RequiresNew logic in the full legacy Diff.
|
||||||
for k, attr := range instanceDiff.Attributes {
|
for k, attr := range instanceDiff.Attributes {
|
||||||
@ -331,14 +336,9 @@ func (r *Resource) simpleDiff(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if instanceDiff != nil {
|
if err := t.DiffEncode(instanceDiff); err != nil {
|
||||||
if err := t.DiffEncode(instanceDiff); err != nil {
|
log.Printf("[ERR] Error encoding timeout to instance diff: %s", err)
|
||||||
log.Printf("[ERR] Error encoding timeout to instance diff: %s", err)
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
log.Printf("[DEBUG] Instance Diff is nil in Diff()")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return instanceDiff, err
|
return instanceDiff, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user