minor fix
authorThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Tue, 29 Mar 2011 09:24:34 +0000 (11:24 +0200)
committerThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Tue, 29 Mar 2011 09:24:34 +0000 (11:24 +0200)
plekit/table/table.js

index 31ab09c..f0b0bb3 100644 (file)
@@ -89,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