Author: nextgens
Date: 2008-07-22 09:55:48 +0000 (Tue, 22 Jul 2008)
New Revision: 21302

Modified:
   trunk/freenet/src/freenet/clients/http/StatisticsToadlet.java
Log:
prevent an ArithmeticException if no peer is connected

Modified: trunk/freenet/src/freenet/clients/http/StatisticsToadlet.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/StatisticsToadlet.java       
2008-07-22 01:04:00 UTC (rev 21301)
+++ trunk/freenet/src/freenet/clients/http/StatisticsToadlet.java       
2008-07-22 09:55:48 UTC (rev 21302)
@@ -807,6 +807,8 @@

        static void drawBandwidth(HTMLNode activityList, Node node, long 
nodeUptimeSeconds, boolean isAdvancedModeEnabled) {
                long[] total = node.collector.getTotalIO();
+               if(total[0] == 0 || total[1] == 0)
+                       return;
                long total_output_rate = (total[0]) / nodeUptimeSeconds;
                long total_input_rate = (total[1]) / nodeUptimeSeconds;
                long totalPayload = node.getTotalPayloadSent();


Reply via email to