From: Adam Dickmeiss Date: Tue, 3 Aug 2010 10:59:03 +0000 (+0200) Subject: Avoid crash if facet use attribute is not supplied X-Git-Tag: v4.0.12~9^2~11 X-Git-Url: http://sru.miketaylor.org.uk/?a=commitdiff_plain;h=8c9f54ecfc72ad52e773899df09170a7ab295a50;p=yaz-moved-to-github.git Avoid crash if facet use attribute is not supplied --- diff --git a/ztest/ztest.c b/ztest/ztest.c index 7ddb3c6..2277398 100644 --- 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); - 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++;