Martin Betak has uploaded a new change for review.

Change subject: webadmin: Fix NPE in New VM dialog
......................................................................

webadmin: Fix NPE in New VM dialog

Regression caused by
416cd92a94bbc95c8e5bca17f3707d2016208668
which expected that the selected item is
always set in VmListModel.onSave(). The problem was
that it is true only for edit VM - not for new.

Change-Id: I1e653f428f8a058532030483e7bb115961d706c3
Signed-off-by: Martin Betak <[email protected]>
---
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmListModel.java
1 file changed, 3 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/55/16655/1

diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmListModel.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmListModel.java
index 7f7595a..6d2e89d 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmListModel.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmListModel.java
@@ -1979,8 +1979,6 @@
         getcurrentVm().setCpuPinning((String) model.getCpuPinning()
                 .getEntity());
         getcurrentVm().setVncKeyboardLayout((String) 
model.getVncKeyboardLayout().getSelectedItem());
-        // explicitly pass non-editable field from the original VM
-        getcurrentVm().setCreatedByUserId(selectedItem.getCreatedByUserId());
 
         if ((Boolean) model.getIsAutoAssign().getEntity()) {
             getcurrentVm().setDedicatedVmForVds(null);
@@ -2095,6 +2093,9 @@
                 return;
             }
 
+            // explicitly pass non-editable field from the original VM
+            
getcurrentVm().setCreatedByUserId(selectedItem.getCreatedByUserId());
+
             // runEditVM: should be true if Cluster hasn't changed or if
             // Cluster has changed and Editing it in the Backend has succeeded:
             Guid oldClusterID = selectedItem.getVdsGroupId();


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

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

Reply via email to