DeployVmCmd: Fix NPE case

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
(cherry picked from commit d2bf21065eb650ae2b58c5ab548c8c72a97b76b9)
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 6e3009a299
commit 1c616392db

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>();