Fix crash in parsing solution/project

This commit is contained in:
amai2012 2016-08-24 12:17:54 +02:00
parent c0401c2ef5
commit 7cc2124176
1 changed files with 12 additions and 8 deletions

View File

@ -214,10 +214,12 @@ namespace {
if (a) if (a)
name = a; name = a;
for (const tinyxml2::XMLElement *e = cfg->FirstChildElement(); e; e = e->NextSiblingElement()) { for (const tinyxml2::XMLElement *e = cfg->FirstChildElement(); e; e = e->NextSiblingElement()) {
if (std::strcmp(e->Name(),"Configuration")==0) if (e->GetText()) {
configuration = e->GetText(); if (std::strcmp(e->Name(),"Configuration")==0)
else if (std::strcmp(e->Name(),"Platform")==0) configuration = e->GetText();
platform = e->GetText(); else if (std::strcmp(e->Name(),"Platform")==0)
platform = e->GetText();
}
} }
} }
std::string name; std::string name;
@ -234,10 +236,12 @@ namespace {
if (std::strcmp(e1->Name(), "ClCompile") != 0) if (std::strcmp(e1->Name(), "ClCompile") != 0)
continue; continue;
for (const tinyxml2::XMLElement *e = e1->FirstChildElement(); e; e = e->NextSiblingElement()) { for (const tinyxml2::XMLElement *e = e1->FirstChildElement(); e; e = e->NextSiblingElement()) {
if (std::strcmp(e->Name(), "PreprocessorDefinitions") == 0) if (e->GetText()) {
preprocessorDefinitions = e->GetText(); if (std::strcmp(e->Name(), "PreprocessorDefinitions") == 0)
else if (std::strcmp(e->Name(), "AdditionalIncludeDirectories") == 0) preprocessorDefinitions = e->GetText();
additionalIncludePaths = e->GetText(); else if (std::strcmp(e->Name(), "AdditionalIncludeDirectories") == 0)
additionalIncludePaths = e->GetText();
}
} }
} }
} }