jclouds-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Svet <notificati...@github.com>
Subject Re: [jclouds/jclouds-labs] Fix NPE in building node metadata (#367)
Date Thu, 02 Mar 2017 16:46:08 GMT
neykov requested changes on this pull request.



> @@ -179,8 +180,15 @@ public String apply(Status input) {
       Credentials credentials = credentialStore.get("node#" + virtualMachine.name());
       builder.credentials(LoginCredentials.fromCredentials(credentials));
 
-      builder.publicAddresses(getPublicIpAddresses(virtualMachine.properties().networkProfile().networkInterfaces()));
-      builder.privateAddresses(getPrivateIpAddresses(virtualMachine.properties().networkProfile().networkInterfaces()));
+      Iterable<String> publicIpAddresses = getPublicIpAddresses(virtualMachine.properties().networkProfile().networkInterfaces());
+      Iterable<String> privateIpAddresses = getPrivateIpAddresses(virtualMachine.properties().networkProfile().networkInterfaces());
+
+      if (!Iterables.all(publicIpAddresses, Predicates.<String>isNull())) {

Better fix the implementation of `getPublicIpAddresses` and `getPrivateIpAddresses` to skip
over null values. This will reject the whole collection and there could be valid values in
it.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/367#pullrequestreview-24781128
Mime
View raw message