Skip to content

Commit

Permalink
Add nil check for instanceDiff
Browse files Browse the repository at this point in the history
Signed-off-by: Sergen Yalçın <[email protected]>
  • Loading branch information
sergenyalcin committed Nov 3, 2023
1 parent 146ba71 commit 280b4b0
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions pkg/controller/external_nofork.go
Original file line number Diff line number Diff line change
Expand Up @@ -409,10 +409,13 @@ func (n *noForkExternal) getResourceDataDiff(tr resource.Terraformed, ctx contex
instanceDiff.RawConfig = n.rawConfig
}
timeouts := getTimeoutParameters(n.config)
if instanceDiff.Meta == nil && len(timeouts) > 0 {
instanceDiff.Meta = make(map[string]interface{})
}
if len(timeouts) > 0 {
if instanceDiff == nil {
instanceDiff = tf.NewInstanceDiff()
}
if instanceDiff.Meta == nil {
instanceDiff.Meta = make(map[string]interface{})
}
instanceDiff.Meta[schema.TimeoutKey] = timeouts
}
return instanceDiff, nil
Expand Down

0 comments on commit 280b4b0

Please sign in to comment.