From 6043fb7e201b85e6677680f33660d53abfac1756 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 22 Dec 2005 13:51:12 +0100 Subject: proper handling of failed sanity check in parse_counters + weird getAttribute workaround --- functions.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'functions.js') diff --git a/functions.js b/functions.js index 01f1a1448..b17e8927e 100644 --- a/functions.js +++ b/functions.js @@ -358,6 +358,11 @@ if (!xmlhttp_rpc && typeof XMLHttpRequest!='undefined') { function parse_counters(reply, f_document, title_obj) { try { for (var l = 0; l < reply.childNodes.length; l++) { + if (!reply.childNodes[l] || !reply.childNodes[l].getAttribute) { + // where did this come from? + continue; + } + var id = reply.childNodes[l].getAttribute("id"); var t = reply.childNodes[l].getAttribute("type"); var ctr = reply.childNodes[l].getAttribute("counter"); -- cgit v1.2.3