Author: nextgens
Date: 2008-08-26 11:13:39 +0000 (Tue, 26 Aug 2008)
New Revision: 22171

Modified:
   trunk/freenet/src/freenet/support/io/TempBucketFactory.java
Log:
TempBucket: don't attempt to copy anything if there is nothing to copy!

Modified: trunk/freenet/src/freenet/support/io/TempBucketFactory.java
===================================================================
--- trunk/freenet/src/freenet/support/io/TempBucketFactory.java 2008-08-26 
08:35:40 UTC (rev 22170)
+++ trunk/freenet/src/freenet/support/io/TempBucketFactory.java 2008-08-26 
11:13:39 UTC (rev 22171)
@@ -96,7 +96,8 @@
                                // Update the global link so that all streams 
will be reset
                                // DO NOT INCREMENT THE osIndex HERE!
                                os = tempFB.getOutputStream();
-                               BucketTools.copyTo(toMigrate, os, currentSize);
+                               if(currentSize > 0)
+                                       BucketTools.copyTo(toMigrate, os, 
currentSize);
                                if(toMigrate.isReadOnly())
                                        tempFB.setReadOnly();
                                currentBucket = tempFB;


Reply via email to