From ab7689c223ad726b67757245b48e23fd830b00c7 Mon Sep 17 00:00:00 2001 From: megacz Date: Fri, 30 Jan 2004 07:01:05 +0000 Subject: [PATCH] 2003/06/13 04:19:28 darcs-hash:20040130070105-2ba56-fc858a943985d99db30b05c99f98a5bf95387a93.gz --- src/org/xwt/Box.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/org/xwt/Box.java b/src/org/xwt/Box.java index c53ccc4..c01cdde 100644 --- a/src/org/xwt/Box.java +++ b/src/org/xwt/Box.java @@ -1062,7 +1062,7 @@ public final class Box extends JS.Scope { public Object get(int i) { if (redirect == null) return null; if (redirect != this) return redirect.get(i); - return i >= numChildren() ? null : getChild(i); + return i >= numChildren() || i < 0 ? null : getChild(i); } /** @@ -1072,6 +1072,7 @@ public final class Box extends JS.Scope { * WARNING: O(n) runtime, unless i == numChildren() */ public void put(int i, Object value) { + if (i < 0) return; if (value != null && !(value instanceof Box)) { if (Log.on) Log.log(this, "attempt to set a numerical property on a box to anything other than a box at " + Context.getCurrentSourceNameAndLine()); -- 1.7.10.4