As things are, if there are no children of the passed element, we'll have a NULL dereference.
{
const TiXmlElement *pChild;
- for (pChild = pElement->FirstChild()->ToElement(); pChild != 0; pChild = pChild->NextSibling()->ToElement())
+ for (pChild = pElement->FirstChildElement(); pChild != 0; pChild = pChild->NextSiblingElement())
{
if (ValueWithoutNamespace(pChild, "status"))
{
- return pChild->GetText();
+ return pChild->NoChildren() ? "" : pChild->FirstChild()->ValueStr();
}
}