Author: toad
Date: 2007-06-13 00:07:38 +0000 (Wed, 13 Jun 2007)
New Revision: 13551

Modified:
   trunk/freenet/src/freenet/io/xfer/PartiallyReceivedBulk.java
Log:
Fix rare java.lang.NegativeArraySizeException

Modified: trunk/freenet/src/freenet/io/xfer/PartiallyReceivedBulk.java
===================================================================
--- trunk/freenet/src/freenet/io/xfer/PartiallyReceivedBulk.java        
2007-06-13 00:04:52 UTC (rev 13550)
+++ trunk/freenet/src/freenet/io/xfer/PartiallyReceivedBulk.java        
2007-06-13 00:07:38 UTC (rev 13551)
@@ -176,6 +176,11 @@
        }

        public synchronized void remove(BulkTransmitter remove) {
+               boolean found = false;
+               for(int i=0;i<transmitters.length;i++) {
+                       if(transmitters[i] == remove) found = true;
+               }
+               if(!found) return;
                BulkTransmitter[] newTrans = new 
BulkTransmitter[transmitters.length-1];
                int j = 0;
                for(int i=0;i<transmitters.length;i++) {


Reply via email to