[Laszlo-checkins] r10200 - openlaszlo/trunk/WEB-INF/lps/lfc/data

bargull@openlaszlo.org bargull at openlaszlo.org
Thu Jul 3 15:28:33 PDT 2008


Author: bargull
Date: 2008-07-03 15:28:30 -0700 (Thu, 03 Jul 2008)
New Revision: 10200

Modified:
   openlaszlo/trunk/WEB-INF/lps/lfc/data/LzDatapointer.lzs
Log:
Change 20080704-bargull-PS0 by bargull at dell--p4--2-53 on 2008-07-04 00:02:22
    in /home/Admin/src/svn/openlaszlo/trunk
    for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: check for valid pointer

New Features:

Bugs Fixed: LPP-6606

Technical Reviewer: hminsky
QA Reviewer: (pending)
Doc Reviewer: (pending)

Documentation:

Release Notes:

Details:
Just added the common check in LzDatapointer to "getXPathIndex()".
    

Tests:



Modified: openlaszlo/trunk/WEB-INF/lps/lfc/data/LzDatapointer.lzs
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/data/LzDatapointer.lzs	2008-07-03 22:08:24 UTC (rev 10199)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/data/LzDatapointer.lzs	2008-07-03 22:28:30 UTC (rev 10200)
@@ -900,10 +900,18 @@
 
 /**
   * Returns the number of the node that the datapointer is pointing to.
+  * If the datapointer does not point to a valid node, 0 is returned.
   * Note that XPath indices are 1-based.
-  * @return Number: The offset of the node
+  * @return Number: The offset of the node or 0
   */
 function getXPathIndex ():Number { 
+    if ( ! this.p ) {
+        if ( $debug ) {
+            Debug.info("%s: p is null in %s", arguments.callee, this);
+        }
+        return 0;
+    }
+    
     return this.p.getOffset() + 1;
 }
 



More information about the Laszlo-checkins mailing list