From 6e4079e3e414020ded00dd106bada67a9d3468b2 Mon Sep 17 00:00:00 2001 From: Markus Lampert Date: Thu, 21 Sep 2017 22:44:45 -0700 Subject: [PATCH] Path selection resiliency against selections without sub features - which seem to have become common place. --- src/Mod/Path/PathScripts/PathSelection.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Mod/Path/PathScripts/PathSelection.py b/src/Mod/Path/PathScripts/PathSelection.py index 5bb5c89f7e..8102ef106e 100644 --- a/src/Mod/Path/PathScripts/PathSelection.py +++ b/src/Mod/Path/PathScripts/PathSelection.py @@ -35,12 +35,12 @@ if False: class EGate: def allow(self, doc, obj, sub): - return (sub[0:4] == 'Edge') + return sub and sub[0:4] == 'Edge' class MESHGate: def allow(self, doc, obj, sub): - return (obj.TypeId[0:4] == 'Mesh') + return obj.TypeId[0:4] == 'Mesh' class ENGRAVEGate: @@ -81,20 +81,20 @@ class PROFILEGate: profileable = False elif obj.ShapeType == 'Compound': - if sub[0:4] == 'Face': + if sub and sub[0:4] == 'Face': profileable = True - if sub[0:4] == 'Edge': + if sub and sub[0:4] == 'Edge': profileable = False elif obj.ShapeType == 'Face': profileable = False elif obj.ShapeType == 'Solid': - if sub[0:4] == 'Face': + if sub and sub[0:4] == 'Face': profileable = True - if sub[0:4] == 'Edge': + if sub and sub[0:4] == 'Edge': profileable = False elif obj.ShapeType == 'Wire': @@ -119,11 +119,11 @@ class POCKETGate: pocketable = True elif obj.ShapeType == 'Solid': - if sub[0:4] == 'Face': + if sub and sub[0:4] == 'Face': pocketable = True elif obj.ShapeType == 'Compound': - if sub[0:4] == 'Face': + if sub and sub[0:4] == 'Face': pocketable = True return pocketable