string id;
xmlAttr *id_attr = NULL;
for (xmlAttr *attr = child->properties; attr != NULL; attr = attr->next) {
- if (strcmp(reinterpret_cast<const char *>(attr->ns->href), "http://template.sesse.net/") == 0 &&
+ if (attr->ns != NULL &&
+ strcmp(reinterpret_cast<const char *>(attr->ns->href), "http://template.sesse.net/") == 0 &&
strcmp(reinterpret_cast<const char *>(attr->name), "id") == 0) {
xmlChar *id_buf = xmlNodeGetContent(attr->children);
id = reinterpret_cast<const char *>(id_buf);