mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-27 02:31:09 +00:00
fix poll breaking with no active object
This commit is contained in:
@@ -278,7 +278,7 @@ class SwitchRepresentation(bpy.types.Operator, tool.Ifc.Operator):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
if context.active_object.mode == "OBJECT":
|
if (obj := context.active_object) and obj.mode == "OBJECT":
|
||||||
return True
|
return True
|
||||||
cls.poll_message_set("Only available in OBJECT mode - Press TAB in the viewport")
|
cls.poll_message_set("Only available in OBJECT mode - Press TAB in the viewport")
|
||||||
return False
|
return False
|
||||||
|
|||||||
Reference in New Issue
Block a user