DeployVmCmd: Fix NPE case

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
Rohit Yadav 2015-02-06 14:20:32 +05:30
parent 82eebab0ba
commit d2bf21065e
1 changed files with 2 additions and 2 deletions

View File

@ -300,8 +300,8 @@ public class DeployVMCmd extends BaseAsyncCreateCustomIdCmd {
}
public List<Long> getNetworkIds() {
if (ipToNetworkList != null) {
if (networkIds != null || ipAddress != null || getIp6Address() != null) {
if (ipToNetworkList != null && !ipToNetworkList.isEmpty()) {
if ((networkIds != null && !newtworkIds.isEmpty()) || ipAddress != null || getIp6Address() != null) {
throw new InvalidParameterValueException("ipToNetworkMap can't be specified along with networkIds or ipAddress");
} else {
List<Long> networks = new ArrayList<Long>();