Skip to content

Commit

Permalink
webadmin: Intermittent UI exception while opening the Import Virtual …
Browse files Browse the repository at this point in the history
…Machine(s) pop-up (#925)

Check for null values to avoid UI exceptions.

Signed-off-by: ShubhaOracle <[email protected]>
  • Loading branch information
shubhaOracle authored Dec 16, 2024
1 parent f453110 commit 89b2cd1
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -312,8 +312,13 @@ protected Double getSpeed(VmNetworkInterface object) {
AbstractTextColumn<VmNetworkInterface> dropsColumn = new AbstractSumUpColumn<VmNetworkInterface>() {
@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 };
}
};
Expand Down

0 comments on commit 89b2cd1

Please sign in to comment.