Check for attribute nil #7276 #7291

This commit is contained in:
Thomas Krijnen
2025-10-28 10:51:31 +01:00
parent 6df5632f91
commit eb1c81514b
+1 -1
View File
@@ -374,7 +374,7 @@ const IfcUtil::IfcBaseEntity* mapping::get_single_material_association(const Ifc
#endif
#ifdef SCHEMA_HAS_IfcMaterialConstituentSet
if (associated_material->as<IfcSchema::IfcMaterialConstituentSet>()) {
if (associated_material->as<IfcSchema::IfcMaterialConstituentSet>() && associated_material->as<IfcSchema::IfcMaterialConstituentSet>()->MaterialConstituents()) {
IfcSchema::IfcMaterialConstituentSet* constituentset = associated_material->as<IfcSchema::IfcMaterialConstituentSet>();
if (settings_.get<settings::LayersetFirst>().value ? constituentset->MaterialConstituents()->get()->size() >= 1 : constituentset->MaterialConstituents()->get()->size() == 1) {
IfcSchema::IfcMaterialConstituent* constituent = (*constituentset->MaterialConstituents()->get()->begin());