Skip to content

Commit

Permalink
more NPE avoidance in NetworkInterfaceImpl
Browse files Browse the repository at this point in the history
  • Loading branch information
unknown authored and unknown committed Sep 29, 2016
1 parent 778ea23 commit cd16387
Showing 1 changed file with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -332,10 +332,7 @@ public Map<String, NicIpConfiguration> ipConfigurations() {

@Override
public String networkSecurityGroupId() {
if (this.inner().networkSecurityGroup() != null) {
return this.inner().networkSecurityGroup().id();
}
return null;
return (this.inner().networkSecurityGroup() != null) ? this.inner().networkSecurityGroup().id() : null;
}

@Override
Expand Down Expand Up @@ -377,10 +374,14 @@ public NicIpConfigurationImpl primaryIpConfiguration() {
* @return the list of DNS server IPs from the DNS settings
*/
private List<String> dnsServerIps() {
if (this.inner().dnsSettings().dnsServers() == null) {
this.inner().dnsSettings().withDnsServers(new ArrayList<String>());
List<String> dnsServers = new ArrayList<String>();
if (this.inner().dnsSettings() == null) {
return dnsServers;
} else if (this.inner().dnsSettings().dnsServers() == null) {
return dnsServers;
} else {
return this.inner().dnsSettings().dnsServers();
}
return this.inner().dnsSettings().dnsServers();
}

@Override
Expand Down

0 comments on commit cd16387

Please sign in to comment.