From c2a1f748dfc5980165f2bcccfafac233fc908897 Mon Sep 17 00:00:00 2001 From: Edison Su Date: Tue, 8 Mar 2011 20:11:33 -0500 Subject: [PATCH] fix bug when one of template was deleted, then delpoyvm, got NPE --- .../cloud/storage/allocator/AbstractStoragePoolAllocator.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/server/src/com/cloud/storage/allocator/AbstractStoragePoolAllocator.java b/server/src/com/cloud/storage/allocator/AbstractStoragePoolAllocator.java index c226784d2ec..05bb740e0fe 100644 --- a/server/src/com/cloud/storage/allocator/AbstractStoragePoolAllocator.java +++ b/server/src/com/cloud/storage/allocator/AbstractStoragePoolAllocator.java @@ -211,9 +211,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; }