mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-2003: When accounts and domains are deleted, cleanup can fail,
leaving instances in eternal expunged state. This happens when a domain is deleted while a deleted account is cleaning up. The cleanup looks for the domain of the account and we hit a null pointer. Adding null pointer check. Signed-off-by: Marcus Sorensen <marcus@betterservers.com> 1365695448 -0600
This commit is contained in:
parent
d39a06c0e9
commit
ca8ac08cf3
|
|
@ -262,11 +262,14 @@ public class DomainDaoImpl extends GenericDaoBase<DomainVO, Long> implements Dom
|
|||
public Set<Long> getDomainParentIds(long domainId) {
|
||||
Set<Long> parentDomains = new HashSet<Long>();
|
||||
Domain domain = findById(domainId);
|
||||
parentDomains.add(domain.getId());
|
||||
|
||||
while (domain.getParent() != null) {
|
||||
domain = findById(domain.getParent());
|
||||
|
||||
if (domain != null) {
|
||||
parentDomains.add(domain.getId());
|
||||
|
||||
while (domain.getParent() != null) {
|
||||
domain = findById(domain.getParent());
|
||||
parentDomains.add(domain.getId());
|
||||
}
|
||||
}
|
||||
|
||||
return parentDomains;
|
||||
|
|
|
|||
Loading…
Reference in New Issue