fix bug when one of template was deleted, then delpoyvm, got NPE

This commit is contained in:
Edison Su 2011-03-08 20:11:33 -05:00
parent c4ac92af3f
commit ccab6c21c4

View File

@ -212,9 +212,7 @@ public abstract class AbstractStoragePoolAllocator extends AdapterBase implement
}
for (VMTemplateStoragePoolVO templatePoolVO : templatePoolVOs) {
VMTemplateVO templateInPool = _templateDao.findById(templatePoolVO.getTemplateId());
if ((template != null) && !tmpinstalled && (templateInPool.getId() == template.getId())) {
if ((template != null) && !tmpinstalled && (templatePoolVO.getTemplateId() == template.getId())) {
tmpinstalled = true;
}