From 44888165a16282614167090f2f9f45deea00ae1a Mon Sep 17 00:00:00 2001 From: Jakub Skoczen Date: Mon, 4 Jun 2007 12:24:59 +0000 Subject: [PATCH] Handling empty nodes in the termlists. --- js/pz2.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/pz2.js b/js/pz2.js index 334082a..5c32a7b 100644 --- a/js/pz2.js +++ b/js/pz2.js @@ -1,5 +1,5 @@ /* -** $Id: pz2.js,v 1.29 2007-06-04 10:56:28 jakub Exp $ +** $Id: pz2.js,v 1.30 2007-06-04 12:24:59 jakub Exp $ ** pz2.js - pazpar2's javascript client library. */ @@ -417,8 +417,8 @@ pz2.prototype = { //for each term in the list for (j = 0; j < terms.length; j++) { var term = { - "name": terms[j].getElementsByTagName("name")[0].childNodes[0].nodeValue, - "freq": terms[j].getElementsByTagName("frequency")[0].childNodes[0].nodeValue + "name": terms[j].getElementsByTagName("name")[0].childNodes[0].nodeValue || 'ERROR', + "freq": terms[j].getElementsByTagName("frequency")[0].childNodes[0].nodeValue || 'ERROR' }; var termIdNode = terms[j].getElementsByTagName("id"); -- 1.7.10.4