diff --git a/lib/library.cpp b/lib/library.cpp index 4edf10a92..c20ddfffb 100644 --- a/lib/library.cpp +++ b/lib/library.cpp @@ -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()) {