Skip to content

Commit

Permalink
Merge pull request #492 from madenwala/master
Browse files Browse the repository at this point in the history
Nil refence fix for issue #464
  • Loading branch information
madenwala authored Nov 3, 2017
2 parents 7110d04 + 857e5ff commit 1686648
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions azurerm/resource_arm_network_security_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,10 +226,18 @@ func flattenNetworkSecurityRules(rules *[]network.SecurityRule) []interface{} {
sgRule["name"] = *rule.Name

if props := rule.SecurityRulePropertiesFormat; props != nil {
sgRule["destination_address_prefix"] = *props.DestinationAddressPrefix
sgRule["destination_port_range"] = *props.DestinationPortRange
sgRule["source_address_prefix"] = *props.SourceAddressPrefix
sgRule["source_port_range"] = *props.SourcePortRange
if props.DestinationAddressPrefix != nil {
sgRule["destination_address_prefix"] = *props.DestinationAddressPrefix
}
if props.DestinationPortRange != nil {
sgRule["destination_port_range"] = *props.DestinationPortRange
}
if props.SourceAddressPrefix != nil {
sgRule["source_address_prefix"] = *props.SourceAddressPrefix
}
if props.SourcePortRange != nil {
sgRule["source_port_range"] = *props.SourcePortRange
}
sgRule["priority"] = int(*props.Priority)
sgRule["access"] = string(props.Access)
sgRule["direction"] = string(props.Direction)
Expand Down

0 comments on commit 1686648

Please sign in to comment.