mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-26 18:21:59 +00:00
Don't fail on retrieving id of simpletypes
This commit is contained in:
@@ -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.
|
// to expose it to the Python wrapper it is simply duplicated here.
|
||||||
// Same applies to the two methods reimplemented below.
|
// Same applies to the two methods reimplemented below.
|
||||||
int id() const {
|
int id() const {
|
||||||
return $self->as<IfcUtil::IfcBaseEntity>()->id();
|
return $self->as<IfcUtil::IfcBaseEntity>() != nullptr
|
||||||
|
? $self->as<IfcUtil::IfcBaseEntity>()->id()
|
||||||
|
: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int __len__() const {
|
int __len__() const {
|
||||||
|
|||||||
Reference in New Issue
Block a user