From: Dennis Schafroth Date: Thu, 2 Feb 2012 17:35:16 +0000 (+0100) Subject: Check for missing bytarget info nodes before dereferer X-Git-Tag: v1.6.10~8^2^2~6 X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=960523c37aa6741c6e81a1e648f943d6c68112b5;p=pazpar2-moved-to-github.git Check for missing bytarget info nodes before dereferer --- 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") {