Skip to content

Commit ce3c10f

Browse files
fix nil handling
1 parent f93f37b commit ce3c10f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pkg/tfshim/sdk-v2/object_from_cty.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ import (
66
)
77

88
func objectFromCtyValue(val cty.Value) map[string]any {
9-
return objectFromCtyValueInner(val).(map[string]any)
9+
res := objectFromCtyValueInner(val)
10+
if res == nil {
11+
return nil
12+
}
13+
return res.(map[string]any)
1014
}
1115

1216
func objectFromCtyValueInner(val cty.Value) any {

0 commit comments

Comments
 (0)