fix: check default port in map is not nil
This commit is contained in:
1 parent
292a5100bf
commit
d19dd70b06
1 file changed
+4
-3
@@ -65,9 +65,10 @@ func setFromTargetResponseMap(d *schema.ResourceData, raw map[string]interface{}
|
||||
case targetTypeTcp:
|
||||
if attrsVal, ok := raw["attributes"]; ok {
|
||||
attrs := attrsVal.(map[string]interface{})
|
||||
defPort := attrs["default_port"].(json.Number)
|
||||
defPortInt, _ := defPort.Int64()
|
||||
d.Set(targetDefaultPortKey, int(defPortInt))
|
||||
if defPort, ok := attrs["default_port"].(json.Number); ok {
|
||||
defPortInt, _ := defPort.Int64()
|
||||
d.Set(targetDefaultPortKey, int(defPortInt))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user