From 122b0d1aebce0700a53612fa2b23b5a339d7c51c Mon Sep 17 00:00:00 2001 From: abhishek Date: Tue, 21 Sep 2010 15:48:26 -0700 Subject: [PATCH] bug 6243: adding a check to return an error in case we have a null domain id for a non null account status 6243: resolved fixed --- server/src/com/cloud/api/commands/ListVMsCmd.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/src/com/cloud/api/commands/ListVMsCmd.java b/server/src/com/cloud/api/commands/ListVMsCmd.java index a78cbc2e400..59d226340dc 100644 --- a/server/src/com/cloud/api/commands/ListVMsCmd.java +++ b/server/src/com/cloud/api/commands/ListVMsCmd.java @@ -118,6 +118,10 @@ public class ListVMsCmd extends BaseCmd { domainId = account.getDomainId(); } + if(account!=null && domainId==null){ + throw new ServerApiException(BaseCmd.ACCOUNT_ERROR, "Please specify the domain id for this account:"+account.getId()); + } + Long[] accountIds = null; if (accountId != null) { accountIds = new Long[1];