fix crash with null pointer links
in PropertyLinkList handle case with null pointers as value in STEP reader avoid to create coumpound objects with null pointer links
This commit is contained in:
parent
3a3fa30595
commit
bcea759287
|
@ -291,8 +291,14 @@ void PropertyLinkList::Save(Base::Writer &writer) const
|
|||
{
|
||||
writer.Stream() << writer.ind() << "<LinkList count=\"" << getSize() << "\">" << endl;
|
||||
writer.incInd();
|
||||
for (int i = 0; i<getSize(); i++)
|
||||
writer.Stream() << writer.ind() << "<Link value=\"" << _lValueList[i]->getNameInDocument() << "\"/>" << endl;;
|
||||
for (int i = 0; i<getSize(); i++) {
|
||||
DocumentObject* obj = _lValueList[i];
|
||||
if (obj)
|
||||
writer.Stream() << writer.ind() << "<Link value=\"" << obj->getNameInDocument() << "\"/>" << endl;
|
||||
else
|
||||
writer.Stream() << writer.ind() << "<Link value=\"\"/>" << endl;
|
||||
}
|
||||
|
||||
writer.decInd();
|
||||
writer.Stream() << writer.ind() << "</LinkList>" << endl;
|
||||
}
|
||||
|
|
|
@ -211,10 +211,10 @@ void ImportOCAF::loadShapes(const TDF_Label& label, const TopLoc_Location& loc,
|
|||
loadShapes(it.Value(), part_loc, part_name, asm_name, isRef, localValue);
|
||||
}
|
||||
|
||||
if (pcCompound)
|
||||
if (pcCompound) {
|
||||
pcCompound->Links.setValues(localValue);
|
||||
|
||||
lValue.push_back(pcCompound);
|
||||
lValue.push_back(pcCompound);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user