3MF: fix nullptr access.

pull/1048/head
Kim Kulling 2016-10-18 21:16:44 +02:00
parent 5cd16a0aa6
commit bac28061ea
1 changed files with 10 additions and 2 deletions

View File

@ -148,8 +148,16 @@ private:
std::vector<unsigned long> meshIds;
std::string name(xmlReader->getAttributeValue(D3MF::XmlTag::name.c_str()));
std::string type(xmlReader->getAttributeValue(D3MF::XmlTag::type.c_str()));
const char *attrib( nullptr );
std::string name, type;
attrib = xmlReader->getAttributeValue( D3MF::XmlTag::name.c_str() );
if ( nullptr != attrib ) {
name = attrib;
}
attrib = xmlReader->getAttributeValue( D3MF::XmlTag::name.c_str() );
if ( nullptr != attrib ) {
type = attrib;
}
node->mParent = scene->mRootNode;
node->mName.Set(name);