Tomas Jelinek has uploaded a new change for review.

Change subject: engine: add vm from template without disk throws NPE
......................................................................

engine: add vm from template without disk throws NPE

VmCommand.endActionOnDisks() expected to getParametersForChildCommand() always
return some value.

This is not the case if the VM is created from template without disks so it
failes on NPE.

Fixed by simple null check - if there are no child commands there is nothing to
do.

Bug-Url: https://bugzilla.redhat.com/988319
Change-Id: I91ec11a7156c6f26776bc36301e8fa48fbf471b1
Signed-off-by: Tomas Jelinek <[email protected]>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VmCommand.java
1 file changed, 4 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/70/17870/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 59b895f..e623f90 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
@@ -203,6 +203,10 @@
     }
 
     protected void endActionOnDisks() {
+        if (getParametersForChildCommand() == null) {
+            return;
+        }
+
         for (VdcActionParametersBase p : getParametersForChildCommand()) {
             if (overrideChildCommandSuccess()) {
                 p.setTaskGroupSuccess(getParameters().getTaskGroupSuccess());


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I91ec11a7156c6f26776bc36301e8fa48fbf471b1
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Tomas Jelinek <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to