Gilad Chaplik has uploaded a new change for review.

Change subject: core: Fix NPE in QosValidator
......................................................................

core: Fix NPE in QosValidator

Match behavior to prior refactoring made in
http://gerrit.ovirt.org/#/c/31868

Change-Id: If8143c0e7df22c508e257c7549ecb4f93fdbc525
Bug-Url: https://bugzilla.redhat.com/1136272
Signed-off-by: Gilad Chaplik <gchap...@redhat.com>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/validator/QosValidator.java
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/99/32299/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/validator/QosValidator.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/validator/QosValidator.java
index aba3c13..b5d89b1 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/validator/QosValidator.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/validator/QosValidator.java
@@ -23,7 +23,7 @@
     }
 
     protected T getOldQos() {
-        if (oldQos == null) {
+        if (oldQos == null && qos != null) {
             oldQos = getQosDao().get(qos.getId());
         }
         return oldQos;
@@ -51,7 +51,7 @@
      * Verify that the QoS entity has the same DC ID as the one stored in the 
database.
      */
     public ValidationResult consistentDataCenter() {
-        return (getOldQos() == null || 
!qos.getStoragePoolId().equals(getOldQos().getStoragePoolId()))
+        return (qos != null && (getOldQos() == null || 
!qos.getStoragePoolId().equals(getOldQos().getStoragePoolId())))
                 ? new 
ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_QOS_STORAGE_POOL_NOT_CONSISTENT)
                 : ValidationResult.VALID;
     }


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

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

Reply via email to