r9985 - helma/helma/trunk/src/helma/scripting/rhino

[email protected] Thu, 5 Nov 2009 09:11:53 +0100 (CET)
Newsgroups gmane.comp.java.helma.cvs
Message-ID <20091105081153.3BD133D0E2@mia>
Author: hannes
Date: 2009-11-05 09:11:53 +0100 (Thu, 05 Nov 2009)
New Revision: 9985

Modified:
   helma/helma/trunk/src/helma/scripting/rhino/HopObject.java
Log:
Another NPE fix for bug #689
http://dev.helma.org/bugs/show_bug.cgi?id=689

Details at http://dev.helma.org/trac/helma/changeset/9985

Modified: helma/helma/trunk/src/helma/scripting/rhino/HopObject.java
===================================================================
--- helma/helma/trunk/src/helma/scripting/rhino/HopObject.java	2009-11-05 08:03:29 UTC (rev 9984)
+++ helma/helma/trunk/src/helma/scripting/rhino/HopObject.java	2009-11-05 08:11:53 UTC (rev 9985)
@@ -507,7 +507,7 @@
         Node node = (Node) getNode();
         prefetchChildren(start, length);
         SubnodeList list = node.getSubnodeList();
-        length = Math.min(list.size() - start, length);
+        length = list == null ? 0 : Math.min(list.size() - start, length);
         if (length <= 0) {
             return Context.getCurrentContext().newArray(core.global, 0);
         }