Adding simple check

This commit is contained in:
Ian Abreu
2025-07-06 11:07:15 -04:00
parent 82aad7c104
commit 5b962e7ec3

View File

@@ -260,7 +260,10 @@ class CommandPathInspect:
}
def IsActive(self):
obj = FreeCADGui.Selection.getSelection()[0]
selection = FreeCADGui.Selection.getSelection()
if len(selection) == 0:
return False
obj = selection[0].Object
return hasattr(obj, "Path") and len(obj.Path.Commands) > 0
def Activated(self):