incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject [5/5] git commit: api: Fix NullPointerException in ApiResponseHelper for DomainResponse
Date Wed, 19 Dec 2012 01:44:46 GMT
api: Fix NullPointerException in ApiResponseHelper for DomainResponse

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/43425808
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/43425808
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/43425808

Branch: refs/heads/api_refactoring
Commit: 434258080f2dad95bbdbdd67f9517af2eac1cf85
Parents: 22ee420
Author: Rohit Yadav <bhaisaab@apache.org>
Authored: Tue Dec 18 17:15:00 2012 -0800
Committer: Rohit Yadav <bhaisaab@apache.org>
Committed: Tue Dec 18 17:44:17 2012 -0800

----------------------------------------------------------------------
 server/src/com/cloud/api/ApiResponseHelper.java |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/43425808/server/src/com/cloud/api/ApiResponseHelper.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/ApiResponseHelper.java b/server/src/com/cloud/api/ApiResponseHelper.java
index 27fb647..8fa8bad 100755
--- a/server/src/com/cloud/api/ApiResponseHelper.java
+++ b/server/src/com/cloud/api/ApiResponseHelper.java
@@ -440,7 +440,10 @@ public class ApiResponseHelper implements ResponseGenerator {
         domainResponse.setId(domain.getUuid());
         domainResponse.setLevel(domain.getLevel());
         domainResponse.setNetworkDomain(domain.getNetworkDomain());
-        domainResponse.setParentDomainId(ApiDBUtils.findDomainById(domain.getParent()).getUuid());
+        Domain parentDomain = ApiDBUtils.findDomainById(domain.getParent());
+        if (parentDomain != null) {
+            domainResponse.setParentDomainId(parentDomain.getUuid());
+        }
         StringBuilder domainPath = new StringBuilder("ROOT");
         (domainPath.append(domain.getPath())).deleteCharAt(domainPath.length() - 1);
         domainResponse.setPath(domainPath.toString());


Mime
View raw message