From 89b2cd1c605ec09d1180f1237b634af5bb800e4d Mon Sep 17 00:00:00 2001 From: shubhaOracle <67933042+shubhaOracle@users.noreply.github.com> Date: Mon, 16 Dec 2024 09:16:58 -0500 Subject: [PATCH] webadmin: Intermittent UI exception while opening the Import Virtual Machine(s) pop-up (#925) Check for null values to avoid UI exceptions. Signed-off-by: ShubhaOracle --- .../main/view/popup/storage/RegisterEntityInfoPanel.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/storage/RegisterEntityInfoPanel.java b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/storage/RegisterEntityInfoPanel.java index 2d3dcb5ba12..eba906e259c 100644 --- a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/storage/RegisterEntityInfoPanel.java +++ b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/storage/RegisterEntityInfoPanel.java @@ -312,8 +312,13 @@ protected Double getSpeed(VmNetworkInterface object) { AbstractTextColumn dropsColumn = new AbstractSumUpColumn() { @Override protected Double[] getRawValue(VmNetworkInterface object) { - Double receiveDrops = object != null ? object.getStatistics().getReceiveDrops().doubleValue() : null; - Double transmitDrops = object != null ? object.getStatistics().getTransmitDrops().doubleValue() : null; + Double receiveDrops = (object != null && object.getStatistics() != null + && object.getStatistics().getReceiveDrops() != null) + ? object.getStatistics().getReceiveDrops().doubleValue() : 0.0; + Double transmitDrops = (object != null && object.getStatistics() != null + && object.getStatistics().getTransmitDrops() != null) + ? object.getStatistics().getTransmitDrops().doubleValue() : 0.0; + return new Double[] { receiveDrops, transmitDrops }; } };