Moti Asayag has uploaded a new change for review.

Change subject: restapi: Prevent NPE when getting statistics
......................................................................

restapi: Prevent NPE when getting statistics

VDSM doesn't report statistics for all of the network
interfaces (i.e. vlans, see [1] for more details)
therefore the restapi shouldn't expect a wrapper not
to be null and prevent autoboxing to avoid NPE.

[1] https://bugzilla.redhat.com/675560

Change-Id: Iab3422ef11f35b7a75d39f62cc5caa6f827ac7f4
Bug-Url: https://bugzilla.redhat.com/993123
Signed-off-by: Moti Asayag <masa...@redhat.com>
---
M 
backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/util/RxTxCalculator.java
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/61/19461/1

diff --git 
a/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/util/RxTxCalculator.java
 
b/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/util/RxTxCalculator.java
index 4456c07..510316b 100644
--- 
a/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/util/RxTxCalculator.java
+++ 
b/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/util/RxTxCalculator.java
@@ -4,7 +4,7 @@
 
     public static Double percent2bytes(Integer speedValueInMegaBits, Double 
rxTxValueInPrecent) {
         if (speedValueInMegaBits == null || rxTxValueInPrecent == null) {
-            return null;
+            return 0.0;
         }
         return megaBitToByte(speedValueInMegaBits * rxTxValueInPrecent / 100);
     }


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iab3422ef11f35b7a75d39f62cc5caa6f827ac7f4
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-3.3
Gerrit-Owner: Moti Asayag <masa...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to