Liron Aravot has uploaded a new change for review.

Change subject: core : check getVm() return value to avoid NPE
......................................................................

core : check getVm() return value to avoid NPE

getVm() can return null, which might cause to an NPE.

Change-Id: Id404b00d85ab327e2943ce8d37a6f6c30e76d2f5
Signed-off-by: Liron Aravot <lara...@redhat.com>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VmCommand.java
1 file changed, 3 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/23/10623/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VmCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VmCommand.java
index 87ec5e5..129511d 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VmCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VmCommand.java
@@ -182,7 +182,9 @@
     }
 
     protected void endVmCommand() {
-        getVmStaticDAO().incrementDbGeneration(getVm().getId());
+        if (getVm() != null) {
+            getVmStaticDAO().incrementDbGeneration(getVm().getId());
+        }
         endActionOnDisks();
         unlockVm();
         setSucceeded(true);


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

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

Reply via email to