diff --git a/src/ifcwrap/IfcGeomWrapper.i b/src/ifcwrap/IfcGeomWrapper.i index a987a3c473..200ea45bd1 100644 --- a/src/ifcwrap/IfcGeomWrapper.i +++ b/src/ifcwrap/IfcGeomWrapper.i @@ -724,7 +724,7 @@ struct ShapeRTTI : public boost::static_visitor typename Schema::IfcProductRepresentation* prodrep = product->Representation(); typename Schema::IfcRepresentation::list::ptr reps = prodrep->Representations(); - typename Schema::IfcRepresentation* ifc_representation = representation->as(); + typename Schema::IfcRepresentation* ifc_representation = representation ? representation->as() : nullptr; if (!ifc_representation) { // First, try to find a representation based on the settings