Library: return false from load() when tinyxml::FirstChildElement() return a NULL pointer.
This commit is contained in:
parent
63d9fd4210
commit
5156481db4
|
@ -67,7 +67,11 @@ bool Library::load(const char exename[], const char path[])
|
|||
bool Library::load(const tinyxml2::XMLDocument &doc)
|
||||
{
|
||||
const tinyxml2::XMLElement * const rootnode = doc.FirstChildElement();
|
||||
if (rootnode && strcmp(rootnode->Name(),"def") != 0)
|
||||
|
||||
if (rootnode == NULL)
|
||||
return false;
|
||||
|
||||
if (strcmp(rootnode->Name(),"def") != 0)
|
||||
return false;
|
||||
|
||||
for (const tinyxml2::XMLElement *node = rootnode->FirstChildElement(); node; node = node->NextSiblingElement()) {
|
||||
|
|
Loading…
Reference in New Issue