mirror of https://github.com/apache/cloudstack.git
api: Fix NullPointerException in ApiResponseHelper for DomainResponse
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
This commit is contained in:
parent
22ee4200c3
commit
434258080f
|
|
@ -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());
|
||||
|
|
|
|||
Loading…
Reference in New Issue