projects
/
pazpar2-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
96ddfff
)
avoid referencing XML element text when no data in XML element, thus preventing crashes
author
Marc Cromme
<marc@indexdata.dk>
Thu, 1 Nov 2007 10:59:32 +0000
(10:59 +0000)
committer
Marc Cromme
<marc@indexdata.dk>
Thu, 1 Nov 2007 10:59:32 +0000
(10:59 +0000)
js/pz2.js
patch
|
blob
|
history
diff --git
a/js/pz2.js
b/js/pz2.js
index
718c74d
..
ed3c69d
100644
(file)
--- a/
js/pz2.js
+++ b/
js/pz2.js
@@
-1,5
+1,5
@@
/*
/*
-** $Id: pz2.js,v 1.64 2007-10-31 10:29:01 jakub Exp $
+** $Id: pz2.js,v 1.65 2007-11-01 10:59:32 marc Exp $
** pz2.js - pazpar2's javascript client library.
*/
** pz2.js - pazpar2's javascript client library.
*/
@@
-534,8
+534,9
@@
pz2.prototype =
!= 'location' ) {
var nodeName =
recordNode.childNodes[i].nodeName;
!= 'location' ) {
var nodeName =
recordNode.childNodes[i].nodeName;
- var nodeText =
- recordNode.childNodes[i]
+ var nodeText = '';
+ if (recordNode.childNodes[i].firstChild)
+ nodeText = recordNode.childNodes[i]
.firstChild.nodeValue;
record[nodeName] = nodeText;
}
.firstChild.nodeValue;
record[nodeName] = nodeText;
}