From 898e61f1539d274b1d2e5d40aff697c1a3fd21d2 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Mon, 28 Apr 2014 16:07:48 -0500 Subject: [PATCH] IDEMPIERE-1917 Division by zero rendering performance indicator --- .../adempiere/webui/apps/graph/WPerformanceIndicator.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/graph/WPerformanceIndicator.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/graph/WPerformanceIndicator.java index db620f176b..1174fb354a 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/graph/WPerformanceIndicator.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/graph/WPerformanceIndicator.java @@ -160,15 +160,21 @@ public class WPerformanceIndicator extends Panel implements EventListener private void onAfterSize(AfterSizeEvent event) { int width = event.getWidth(); + if (width == 0) + return; // no space to render int height = event.getHeight(); //set normal height if (height == 0) { height = width > 300 ? width * 40 / 100 : width * 85 / 100; + if (height == 0) + return; // no space to render this.setHeight(height+"px"); } else { int ratio = (height * 100) / width; if (ratio > 85 || ratio < 50) { height = width > 300 ? width * 40 / 100 : width * 85 / 100; + if (height == 0) + return; // no space to render this.setHeight(height+"px"); } }