Skip to content

Commit 7f775c6

Browse files
fixed a crash (#5133) (#3579)
Signed-off-by: Modular Magician <[email protected]>
1 parent 184fcbd commit 7f775c6

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

.changelog/5133.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:bug
2+
compute: fixed a crash on `enable` field of `google_compute_router_peer`
3+
```

google-beta/resource_compute_router_peer.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -680,6 +680,9 @@ func flattenNestedComputeRouterBgpPeerManagementType(v interface{}, d *schema.Re
680680
}
681681

682682
func flattenNestedComputeRouterBgpPeerEnable(v interface{}, d *schema.ResourceData, config *Config) interface{} {
683+
if v == nil {
684+
return true
685+
}
683686
b, err := strconv.ParseBool(v.(string))
684687
if err != nil {
685688
// If we can't convert it into a bool return value as is and let caller handle it

0 commit comments

Comments
 (0)