From 27cd362568b729a1b555046b4e2d45222e218a96 Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Fri, 23 Aug 2024 13:58:48 +0200 Subject: [PATCH] Don't fail on retrieving id of simpletypes --- src/ifcwrap/IfcParseWrapper.i | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ifcwrap/IfcParseWrapper.i b/src/ifcwrap/IfcParseWrapper.i index 3c687e1713..cff9922693 100644 --- a/src/ifcwrap/IfcParseWrapper.i +++ b/src/ifcwrap/IfcParseWrapper.i @@ -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()->id(); + return $self->as() != nullptr + ? $self->as()->id() + : 0; } int __len__() const {