bugfix: the slice page was broken when nobody is in slice
[plewww.git] / plekit / table / table.js
index 0f86acb..f0b0bb3 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$ */
-
 var debug=false;
 
 /* for debugging purposes */
@@ -91,14 +89,15 @@ if ('undefined' == typeof Node)
 
 // Extract actual text from a DOM node (remove internal tags and so on)
 function getInnerText(node) {
-       var result = '';
-       if (Node.TEXT_NODE == node.nodeType)
-               return node.nodeValue;
-       if (Node.ELEMENT_NODE != node.nodeType)
-               return '';
-       for (var index = 0; index < node.childNodes.length; ++index)
-               result += getInnerText(node.childNodes.item(index));
-       return result;
+    if (node==undefined) return "";
+    var result = '';
+    if (Node.TEXT_NODE == node.nodeType)
+       return node.nodeValue;
+    if (Node.ELEMENT_NODE != node.nodeType)
+       return '';
+    for (var index = 0; index < node.childNodes.length; ++index)
+       result += getInnerText(node.childNodes.item(index));
+    return result;
 } // getInnerText
 
 // cache in the <tr> node the concatenation of the innerTexts of its cells