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:
parent
d3bd373798
commit
c529de6e07
|
@ -67,7 +67,7 @@ bool Library::load(const char exename[], const char path[])
|
||||||
bool Library::load(const tinyxml2::XMLDocument &doc)
|
bool Library::load(const tinyxml2::XMLDocument &doc)
|
||||||
{
|
{
|
||||||
const tinyxml2::XMLElement * const rootnode = doc.FirstChildElement();
|
const tinyxml2::XMLElement * const rootnode = doc.FirstChildElement();
|
||||||
if (strcmp(rootnode->Name(),"def") != 0)
|
if (rootnode && strcmp(rootnode->Name(),"def") != 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
for (const tinyxml2::XMLElement *node = rootnode->FirstChildElement(); node; node = node->NextSiblingElement()) {
|
for (const tinyxml2::XMLElement *node = rootnode->FirstChildElement(); node; node = node->NextSiblingElement()) {
|
||||||
|
|
Loading…
Reference in New Issue