From 960523c37aa6741c6e81a1e648f943d6c68112b5 Mon Sep 17 00:00:00 2001 From: Dennis Schafroth Date: Thu, 2 Feb 2012 18:35:16 +0100 Subject: [PATCH] Check for missing bytarget info nodes before dereferer --- js/pz2.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/js/pz2.js b/js/pz2.js index 6b76796..096a89d 100644 --- a/js/pz2.js +++ b/js/pz2.js @@ -652,10 +652,17 @@ pz2.prototype = == Node.ELEMENT_NODE ) { var nodeName = targetNodes[i].childNodes[j].nodeName; - var nodeText = - targetNodes[i].childNodes[j] - .firstChild.nodeValue; - bytarget[i][nodeName] = nodeText; + if (tagetNodes[i].childNodes[j].firstChild != null) + { + var nodeText = targetNodes[i].childNodes[j] + .firstChild.nodeValue; + bytarget[i][nodeName] = nodeText; + } + else { + bytarget[i][nodeName] = ""; + } + + } } if (bytarget[i]["state"]=="Client_Disconnected") { -- 1.7.10.4