diff --git a/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/domain/Server.java b/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/domain/Server.java index fa216636cb..88a2e8483f 100644 --- a/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/domain/Server.java +++ b/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/domain/Server.java @@ -354,14 +354,24 @@ public class Server extends Resource { * @return the private ip addresses assigned to the server */ public Set
getPrivateAddresses() { - return ImmutableSet.copyOf(addresses.get(Address.Type.PRIVATE)); + Set
privateAddresses = addresses.get(Address.Type.PRIVATE); + if (privateAddresses == null) { + return ImmutableSet.
of(); + } else { + return ImmutableSet.copyOf(privateAddresses); + } } /** * @return the public ip addresses assigned to the server */ public Set
getPublicAddresses() { - return ImmutableSet.copyOf(addresses.get(Address.Type.PUBLIC)); + Set
publicAddrs = addresses.get(Address.Type.PUBLIC); + if (publicAddrs == null) { + return ImmutableSet.
of(); + } else { + return ImmutableSet.copyOf(publicAddrs); + } } /**