From 5b962e7ec3eca45d0819b2d193d0e9320ed50341 Mon Sep 17 00:00:00 2001 From: Ian Abreu Date: Sun, 6 Jul 2025 11:07:15 -0400 Subject: [PATCH] Adding simple check --- src/Mod/CAM/Path/Main/Gui/Inspect.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Mod/CAM/Path/Main/Gui/Inspect.py b/src/Mod/CAM/Path/Main/Gui/Inspect.py index 055f18de84..569f3ca387 100644 --- a/src/Mod/CAM/Path/Main/Gui/Inspect.py +++ b/src/Mod/CAM/Path/Main/Gui/Inspect.py @@ -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):