TiXmlElement *pElem;
std::string StatusResponse;
pElem = hResponse.FirstChild("StatusResponse").Element();
if (pElem)
StatusResponse = pElem->GetText();
If pElem
is valid but the element contains no text, pElem->GetText()
returns a NULL pointer, causing an exception. How should I handle this?
Thanks.
if (pElem && pElem->GetText())
StatusResponse = pElem->GetText();