Fix #8024 - Fix TypeError when CardinalPoint is None

Guard the int() cast on CardinalPoint in
BIM_OT_edit_assigned_material so a None value (no cardinal
point set) no longer raises a TypeError.

Generated with the assistance of an AI coding tool.
This commit is contained in:
Ryan Schultz
2026-04-29 10:00:35 -05:00
committed by Dion Moult
parent 434b179ed9
commit c999a92aa7
@@ -630,7 +630,7 @@ class EditAssignedMaterial(bpy.types.Operator, tool.Ifc.Operator):
slab.DumbSlabPlaner().regenerate_from_layer_set(layer_set) slab.DumbSlabPlaner().regenerate_from_layer_set(layer_set)
if material_set_usage.is_a("IfcMaterialProfileSetUsage"): if material_set_usage.is_a("IfcMaterialProfileSetUsage"):
if "CardinalPoint" in attributes: if "CardinalPoint" in attributes and attributes["CardinalPoint"] is not None:
attributes["CardinalPoint"] = int(attributes["CardinalPoint"]) attributes["CardinalPoint"] = int(attributes["CardinalPoint"])
ifcopenshell.api.material.edit_profile_usage( ifcopenshell.api.material.edit_profile_usage(
self.file, self.file,