Don't pass around nullptr in case of failed representation mapping

This commit is contained in:
Thomas Krijnen
2024-06-12 14:25:56 +02:00
parent b90c1ee7c9
commit 17a433a97b
2 changed files with 7 additions and 2 deletions
+1 -1
View File
@@ -724,7 +724,7 @@ struct ShapeRTTI : public boost::static_visitor<PyObject*>
typename Schema::IfcProductRepresentation* prodrep = product->Representation();
typename Schema::IfcRepresentation::list::ptr reps = prodrep->Representations();
typename Schema::IfcRepresentation* ifc_representation = (typename Schema::IfcRepresentation*) representation;
typename Schema::IfcRepresentation* ifc_representation = representation->as<typename Schema::IfcRepresentation>();
if (!ifc_representation) {
// First, try to find a representation based on the settings