Library: tinyxml2::FirstChildElement() is capable of returning 0. This fixes a waring of scan.coverity(): CID 1113430 (#1 of 1): Dereference null return value (NULL_RETURNS)

This commit is contained in:
Martin Ettl 2013-10-29 00:36:27 +01:00
parent d3bd373798
commit c529de6e07
1 changed files with 1 additions and 1 deletions

View File

@ -67,7 +67,7 @@ bool Library::load(const char exename[], const char path[])
bool Library::load(const tinyxml2::XMLDocument &doc)
{
const tinyxml2::XMLElement * const rootnode = doc.FirstChildElement();
if (strcmp(rootnode->Name(),"def") != 0)
if (rootnode && strcmp(rootnode->Name(),"def") != 0)
return false;
for (const tinyxml2::XMLElement *node = rootnode->FirstChildElement(); node; node = node->NextSiblingElement()) {