X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=c%2B%2B0x%2Fxml-template.cpp;h=fda97fc7ca97b83e28b8b4ab1f3d35558cd3011f;hb=4e40bd0f58047ceec9e5b162b16f54226bd45977;hp=febece21a0b70a2b2bcfd923b350bba2fbedc9e1;hpb=d171b609042def06f57f4c7cabbee391a3611265;p=xml-template diff --git a/c++0x/xml-template.cpp b/c++0x/xml-template.cpp index febece2..fda97fc 100644 --- a/c++0x/xml-template.cpp +++ b/c++0x/xml-template.cpp @@ -115,7 +115,8 @@ void Substitute::process(xmlNode *node, bool clean) string id; xmlAttr *id_attr = NULL; for (xmlAttr *attr = child->properties; attr != NULL; attr = attr->next) { - if (strcmp(reinterpret_cast(attr->ns->href), "http://template.sesse.net/") == 0 && + if (attr->ns != NULL && + strcmp(reinterpret_cast(attr->ns->href), "http://template.sesse.net/") == 0 && strcmp(reinterpret_cast(attr->name), "id") == 0) { xmlChar *id_buf = xmlNodeGetContent(attr->children); id = reinterpret_cast(id_buf);