From: Thierry Parmentelat Date: Tue, 29 Mar 2011 09:24:34 +0000 (+0200) Subject: minor fix X-Git-Tag: plewww-4.3-64~16 X-Git-Url: http://git.onelab.eu/?p=plewww.git;a=commitdiff_plain;h=9e3acdda026a62b19c554e01d403025cda99fbd9 minor fix --- diff --git a/plekit/table/table.js b/plekit/table/table.js index 31ab09c..f0b0bb3 100644 --- a/plekit/table/table.js +++ b/plekit/table/table.js @@ -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 node the concatenation of the innerTexts of its cells