Shireesh Anjal has uploaded a new change for review.

Change subject: engine: fixed NPE in add host
......................................................................

engine: fixed NPE in add host

The patch http://gerrit.ovirt.org/13001 modified setVds to set the
mVdsId to Empty in case VDS is passed as null. This results in an
NPE as AddVdsCommand explicitly sets VDS to null, and later calls
getVdsIdRef(), expecting it to be null, but is now Empty.

Hence modifying setVds() to not set it to Empty in case of null, but
leave it as null itself.

Change-Id: I369203472969e707cb515bf593f12849b13b694c
Signed-off-by: Shireesh Anjal <[email protected]>
---
M 
backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/auditloghandling/AuditLogableBase.java
1 file changed, 3 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/25/13325/1

diff --git 
a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/auditloghandling/AuditLogableBase.java
 
b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/auditloghandling/AuditLogableBase.java
index 632f2f4..4e45091 100644
--- 
a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/auditloghandling/AuditLogableBase.java
+++ 
b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/auditloghandling/AuditLogableBase.java
@@ -338,7 +338,9 @@
     public void setVds(final VDS value) {
         mVds = value;
         mVdsName = null;
-        mVdsId = (value == null) ? Guid.Empty : value.getId();
+        if (value != null) {
+            mVdsId = value.getId();
+        }
     }
 
     public VM getVm() {


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

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

Reply via email to