# HG changeset patch # User StephaneLenclud # Date 1423518433 -3600 # Node ID 300f44b7f0cce3ae3f31aa55dda1c380a8628679 # Parent bf99a9f669d944202cd42a5f572ca1ae49420d3a Fixing div by zero in network signal animation code of GP1212 displays. diff -r bf99a9f669d9 -r 300f44b7f0cc Server/MainForm.cs --- a/Server/MainForm.cs Mon Feb 09 20:13:28 2015 +0100 +++ b/Server/MainForm.cs Mon Feb 09 22:47:13 2015 +0100 @@ -246,6 +246,11 @@ if (iDisplay.IsOpen() && iNetworkManager.NetworkListManager.IsConnected && iUpdateCountSinceLastNetworkAnimation==0) { int iconCount=iDisplay.IconCount(Display.TMiniDisplayIconType.EMiniDisplayIconNetworkSignal); + if (iconCount <= 0) + { + //Prevents div by zero and other undefined behavior + return; + } iLastNetworkIconIndex++; iLastNetworkIconIndex = iLastNetworkIconIndex % (iconCount*2); for (int i=0;itrue index.htm false - 1 - 0.1.4.%2a + 0 + 0.2.1.%2a false true true