From 8c9f54ecfc72ad52e773899df09170a7ab295a50 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Tue, 3 Aug 2010 12:59:03 +0200 Subject: [PATCH] Avoid crash if facet use attribute is not supplied --- ztest/ztest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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++; -- 1.7.10.4