Don't fail on retrieving id of simpletypes

This commit is contained in:
Thomas Krijnen
2024-08-23 13:58:48 +02:00
parent 2da34deaf1
commit 27cd362568
+3 -1
View File
@@ -242,7 +242,9 @@ static IfcUtil::ArgumentType helper_fn_attribute_type(const IfcUtil::IfcBaseClas
// to expose it to the Python wrapper it is simply duplicated here.
// Same applies to the two methods reimplemented below.
int id() const {
return $self->as<IfcUtil::IfcBaseEntity>()->id();
return $self->as<IfcUtil::IfcBaseEntity>() != nullptr
? $self->as<IfcUtil::IfcBaseEntity>()->id()
: 0;
}
int __len__() const {