Author: jflesch
Date: 2007-01-05 06:55:26 +0000 (Fri, 05 Jan 2007)
New Revision: 11569

Modified:
   trunk/apps/Thaw/src/thaw/plugins/index/IndexCategory.java
Log:
Fix a weird bug ; will try to understand why it happen later ( 
https://bugs.freenetproject.org/view.php?id=1055 )

Modified: trunk/apps/Thaw/src/thaw/plugins/index/IndexCategory.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/index/IndexCategory.java   2007-01-05 
00:14:59 UTC (rev 11568)
+++ trunk/apps/Thaw/src/thaw/plugins/index/IndexCategory.java   2007-01-05 
06:55:26 UTC (rev 11569)
@@ -374,13 +374,18 @@
                }
        }

-       public void set(final Vector children, final int position, final 
TreeNode node) {
+       public void set(final Vector children, int position, final TreeNode 
node) {
                if((node == this) || (node == null))
                        return;

                if (children == null)
                        loadChildren();

+               if (position < 0) {
+                       Logger.warning(this, "set(Vector, int position, 
TreeNode) : Gave a stupid position: "+position);
+                       position = 0;
+               }
+
                if(children.size() <= position) {
                        children.setSize(position+1);
                } else {


Reply via email to