From 9e3acdda026a62b19c554e01d403025cda99fbd9 Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Tue, 29 Mar 2011 11:24:34 +0200 Subject: [PATCH] minor fix --- plekit/table/table.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) 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 -- 2.43.0