From: Dennis Schafroth Date: Thu, 20 May 2010 13:14:28 +0000 (+0200) Subject: Log fatal instead of crashing hard on wrongly configured metadata element. X-Git-Tag: v1.4.1~6^2~3 X-Git-Url: http://sru.miketaylor.org.uk/?a=commitdiff_plain;h=4208d2ae922fa0d0d61fb14a5b69a10dfefba0fc;p=pazpar2-moved-to-github.git Log fatal instead of crashing hard on wrongly configured metadata element. --- diff --git a/src/session.c b/src/session.c index 4910ea9..0c914ca 100644 --- a/src/session.c +++ b/src/session.c @@ -981,7 +981,10 @@ static int get_mergekey_from_doc(xmlDoc *doc, xmlNode *root, const char *name, if (!strcmp((const char *) n->name, "metadata")) { xmlChar *type = xmlGetProp(n, (xmlChar *) "type"); - if (!strcmp(name, (const char *) type)) + if (type == NULL) { + yaz_log(YLOG_FATAL, "Missing type attribute on metadata element. Skipping!"); + } + else if (!strcmp(name, (const char *) type)) { xmlChar *value = xmlNodeListGetString(doc, n->children, 1); if (value)