projects
/
yaz-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:
7e39a15
)
Avoid crash if facet use attribute is not supplied
author
Adam Dickmeiss
<adam@indexdata.dk>
Tue, 3 Aug 2010 10:59:03 +0000
(12:59 +0200)
committer
Adam Dickmeiss
<adam@indexdata.dk>
Tue, 3 Aug 2010 10:59:03 +0000
(12:59 +0200)
ztest/ztest.c
patch
|
blob
|
history
diff --git
a/ztest/ztest.c
b/ztest/ztest.c
index
7ddb3c6
..
2277398
100644
(file)
--- a/
ztest/ztest.c
+++ b/
ztest/ztest.c
@@
-258,7
+258,7
@@
Z_OtherInformation *build_facet_response(ODR odr, Z_FacetList *facet_list) {
yaz_log(YLOG_LOG, "Attributes: %s %d ", attrvalues.useattr, attrvalues.limit);
if (attrvalues.errstring)
yaz_log(YLOG_LOG, "Error parsing attributes: %s", attrvalues.errstring);
yaz_log(YLOG_LOG, "Attributes: %s %d ", attrvalues.useattr, attrvalues.limit);
if (attrvalues.errstring)
yaz_log(YLOG_LOG, "Error parsing attributes: %s", attrvalues.errstring);
- if (attrvalues.limit > 0) {
+ if (attrvalues.limit > 0 && attrvalues.useattr) {
new_list->elements[new_index] = facet_field_create(odr, facet_list->elements[index]->attributes, attrvalues.limit);
addterms(odr, new_list->elements[new_index], attrvalues.useattr);
new_index++;
new_list->elements[new_index] = facet_field_create(odr, facet_list->elements[index]->attributes, attrvalues.limit);
addterms(odr, new_list->elements[new_index], attrvalues.useattr);
new_index++;