Merge pull request #745 from nlivens/CLOUDSTACK-8773

CLOUDSTACK-8773 : NPE in CheckRouterTask, when a DomainRouter happens to be expunged at the same time

* pr/745:
  CLOUDSTACK-8773 : NPE in CheckRouterTask, when a DomainRouter happens to be expunged at the same time

Signed-off-by: Rajani Karuturi <rajani.karuturi@citrix.com>
This commit is contained in:
Rajani Karuturi 2015-08-26 15:54:41 +05:30
commit 46a5f4bc91
1 changed files with 2 additions and 1 deletions

View File

@ -23,6 +23,7 @@ import javax.annotation.PostConstruct;
import javax.ejb.Local;
import javax.inject.Inject;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.stereotype.Component;
import com.cloud.host.HostVO;
@ -252,7 +253,7 @@ public class DomainRouterDaoImpl extends GenericDaoBase<DomainRouterVO, Long> im
final List<DomainRouterVO> routerIds = listBy(sc);
final List<DomainRouterVO> routers = new ArrayList<DomainRouterVO>();
for (final DomainRouterVO router : routerIds) {
routers.add(findById(router.getId()));
CollectionUtils.addIgnoreNull(routers, findById(router.getId()));
}
return routers;
}