Skip to content

Commit 70af369

Browse files
NPA-1323: Added check for handling invalid ref (#284)
1 parent a0ba662 commit 70af369

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

internal/utils/utils.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,9 @@ func ToComputedAttribute(name string, val resourceschema.Attribute) resourcesche
370370

371371
func ExtractResourceRef(ref string) string {
372372
v := strings.SplitN(strings.Trim(ref, "/"), "/", 2)
373+
if len(v) < 2 {
374+
return ref
375+
}
373376
return v[1]
374377
}
375378

0 commit comments

Comments
 (0)