From: Sebastian Hammer Date: Fri, 13 Apr 2007 17:19:53 +0000 (+0000) Subject: Introduced a check for empty value in record processing X-Git-Tag: PAZPAR2.1.0.0~303 X-Git-Url: http://git.indexdata.com/?a=commitdiff_plain;h=0d339cc417b6d5654b80f896c80844704c62b226;p=pazpar2-moved-to-github.git Introduced a check for empty value in record processing --- diff --git a/js/pz2.js b/js/pz2.js index ff5ca24..2cacae9 100644 --- a/js/pz2.js +++ b/js/pz2.js @@ -1,5 +1,5 @@ /* -** $Id: pz2.js,v 1.5 2007-04-03 14:27:21 jakub Exp $ +** $Id: pz2.js,v 1.6 2007-04-13 17:19:53 quinn Exp $ ** pz2.js - pazpar2's javascript client library. */ @@ -308,7 +308,11 @@ pz2.prototype = { for ( j = 0; j < locationNodes[i].childNodes.length; j++) { if ( locationNodes[i].childNodes[j].nodeType == Node.ELEMENT_NODE ) { var nodeName = locationNodes[i].childNodes[j].nodeName; - var nodeText = locationNodes[i].childNodes[j].firstChild.nodeValue; + var nodeText; + if (locationNodes[i].childNodes[j].firstChild) + nodeText = locationNodes[i].childNodes[j].firstChild.nodeValue; + else + nodeText = ''; record["location"][i][nodeName] = nodeText; } } diff --git a/www/masterkey/js/client.js b/www/masterkey/js/client.js index 8b46f49..9838160 100644 --- a/www/masterkey/js/client.js +++ b/www/masterkey/js/client.js @@ -1,5 +1,5 @@ /* -** $Id: client.js,v 1.12 2007-04-13 01:10:21 quinn Exp $ +** $Id: client.js,v 1.13 2007-04-13 17:19:53 quinn Exp $ ** MasterKey - pazpar2's javascript client . */ @@ -90,6 +90,7 @@ function my_onshow(data) currentDetailedId = null; return; } else if (currentDetailedId != null) { + $(this.parentNode.lastChild).remove(); $('#rec_'+currentDetailedId).children('.detail').remove(); } currentDetailedId = clickedId;