Initialize the attributes of IfcLateBoundEntity to NULL upon construction.

Make sure IfcWritableEntity does not return null pointers, since getArgumentCount() is unreliable for instances being created from keyword arguments in Python.
This commit is contained in:
Thomas Krijnen
2015-02-19 20:20:47 +00:00
parent 6822e84849
commit 8f853ac5af
2 changed files with 10 additions and 1 deletions
+4
View File
@@ -48,6 +48,10 @@ IfcParse::IfcLateBoundEntity::IfcLateBoundEntity(const std::string& s) {
for (std::string::iterator i = S.begin(); i != S.end(); ++i ) *i = toupper(*i);
_type = IfcSchema::Type::FromString(S);
entity = new IfcWrite::IfcWritableEntity(_type);
for (unsigned i = 0; i < getArgumentCount(); ++i) {
// Side effect of this is that a NULL attribute is created.
entity->getArgument(i);
}
IfcSchema::Type::PopulateDerivedFields(writable_entity());
}
IfcParse::IfcLateBoundEntity::IfcLateBoundEntity(IfcAbstractEntity* e) {