Eli Mesika has uploaded a new change for review.

Change subject: core:Cannot add external event if flood rate is...
......................................................................

core:Cannot add external event if flood rate is...

Cannot add external event if flood rate is not passed explicitly

Fixing a NPE when the optional flood rate parameter is not set by adding
a check before the value is used

Change-Id: I73a028199bf49a08be5df6f9a72b4cb12fbd1343
Signed-off-by: Eli Mesika <emes...@redhat.com>
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=908775
---
M 
backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/EventMapper.java
1 file changed, 3 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/47/11847/1

diff --git 
a/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/EventMapper.java
 
b/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/EventMapper.java
index 8e05691..e84ccc0 100644
--- 
a/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/EventMapper.java
+++ 
b/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/EventMapper.java
@@ -127,7 +127,9 @@
             auditLog.setOrigin(event.getOrigin());
         }
         auditLog.setCustomEventId(event.getCustomId());
-        auditLog.setEventFloodInSec(event.getFloodRate());
+        if (event.isSetFloodRate()) {
+            auditLog.setEventFloodInSec(event.getFloodRate());
+        }
         if (event.isSetCustomData()) {
             auditLog.setCustomData(event.getCustomData());
         }


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

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

Reply via email to