Issue 552:VCloudClient getNetwork returns java.lang.NullPointerException: internalIP

This commit is contained in:
Adrian Cole 2011-05-12 17:42:52 -07:00
parent 6e483c7f7c
commit 20e3389a2d
1 changed files with 3 additions and 2 deletions

View File

@ -18,6 +18,7 @@
*/ */
package org.jclouds.vcloud.xml; package org.jclouds.vcloud.xml;
import static org.jclouds.util.SaxUtils.equalsOrSuffix;
import static org.jclouds.vcloud.util.Utils.newReferenceType; import static org.jclouds.vcloud.util.Utils.newReferenceType;
import java.util.List; import java.util.List;
@ -271,11 +272,11 @@ public class OrgNetworkHandler extends ParseSax.HandlerWithResult<OrgNetwork> {
this.vmNicId = -1; this.vmNicId = -1;
} else if (qName.equalsIgnoreCase("ExternalPort")) { } else if (qName.equalsIgnoreCase("ExternalPort")) {
externalPort = Integer.parseInt(currentOrNull()); externalPort = Integer.parseInt(currentOrNull());
} else if (qName.equalsIgnoreCase("IxternalIP")) { } else if (qName.equalsIgnoreCase("InternalIP")) {
internalIP = currentOrNull(); internalIP = currentOrNull();
} else if (qName.equalsIgnoreCase("InternalPort")) { } else if (qName.equalsIgnoreCase("InternalPort")) {
internalPort = Integer.parseInt(currentOrNull()); internalPort = Integer.parseInt(currentOrNull());
} else if (qName.equals("NatProtocol")) { } else if (equalsOrSuffix(qName, "Protocol")) {
natProtocol = NatProtocol.valueOf(currentOrNull()); natProtocol = NatProtocol.valueOf(currentOrNull());
} else if (qName.equals("PortForwardingRule")) { } else if (qName.equals("PortForwardingRule")) {
natRules.add(new PortForwardingRule(externalIP, externalPort, internalIP, internalPort, natProtocol)); natRules.add(new PortForwardingRule(externalIP, externalPort, internalIP, internalPort, natProtocol));