the associatedNetwork is @Nullable so guard against (a fatal) NPE

This commit is contained in:
Alex Heneveld 2012-11-30 15:55:51 -08:00
parent ed471a2eba
commit 95b220f26f
1 changed files with 2 additions and 2 deletions

View File

@ -35,12 +35,12 @@ public class PublicIPAddressPredicates {
private final String networkId;
public AssociatedWithNetwork(String networkId) {
this.networkId = networkId;
this.networkId = checkNotNull(networkId, "networkId");
}
@Override
public boolean apply(PublicIPAddress input) {
return checkNotNull(input, "ipaddress").getAssociatedNetworkId().equals(networkId);
return networkId.equals(checkNotNull(input, "ipaddress").getAssociatedNetworkId());
}
@Override