NPE in vcloud

This commit is contained in:
Adrian Cole 2010-10-28 15:04:41 -07:00
parent c50b8a5dbd
commit ea8cca231a
1 changed files with 3 additions and 2 deletions

View File

@ -73,8 +73,9 @@ public class VAppToNodeMetadata implements Function<VApp, NodeMetadata> {
builder.publicAddresses(getPublicIpsFromVApp(from));
builder.privateAddresses(getPrivateIpsFromVApp(from));
builder.credentials(getCredentialsFrom(from));
if (!credentialStore.containsKey("node#" + from.getHref().toASCIIString()))
credentialStore.put("node#" + from.getHref().toASCIIString(), getCredentialsFrom(from));
Credentials fromApi = getCredentialsFrom(from);
if (fromApi != null && !credentialStore.containsKey("node#" + from.getHref().toASCIIString()))
credentialStore.put("node#" + from.getHref().toASCIIString(), fromApi);
builder.credentials(credentialStore.get("node#" + from.getHref().toASCIIString()));
return builder.build();
}