Amit Aviram has uploaded a new change for review.

Change subject: core: Nullity check in GetVmTemplateQuery
......................................................................

core: Nullity check in GetVmTemplateQuery

Nullity check added to VM template- the query tries to get a template
from the DB and didn't check if the returned value is null which will
result in NullPointerException thrown from the query.

Change-Id: I994083a491db2b78f3ce24783fb0afa3348030d3
Bug-Url: https://bugzilla.redhat.com/??????
Signed-off-by: Amit Aviram <aavi...@redhat.com>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/GetVmTemplateQuery.java
1 file changed, 4 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/36/35136/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/GetVmTemplateQuery.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/GetVmTemplateQuery.java
index e751da7..50082bf 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/GetVmTemplateQuery.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/GetVmTemplateQuery.java
@@ -19,8 +19,10 @@
             vmt = DbFacade.getInstance().getVmTemplateDao()
                 .get(getParameters().getId(), getUserID(), 
getParameters().isFiltered());
         }
-        VmTemplateHandler.updateDisksFromDb(vmt);
-        VmHandler.updateVmInitFromDB(vmt, true);
+        if (vmt != null) {
+            VmTemplateHandler.updateDisksFromDb(vmt);
+            VmHandler.updateVmInitFromDB(vmt, true);
+        }
         getQueryReturnValue().setReturnValue(vmt);
     }
 }


-- 
To view, visit http://gerrit.ovirt.org/35136
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I994083a491db2b78f3ce24783fb0afa3348030d3
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Amit Aviram <aavi...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to