From bd796c9197ee4b7009dc30beed0b686b3c5d3634 Mon Sep 17 00:00:00 2001 From: Uwe Date: Fri, 12 Aug 2022 05:26:56 +0200 Subject: [PATCH] [FEM] Selection: fix error for 2D shapes - 2D shapes have no "Shape" attribute. This attribute was accessed before checked it it exists --- src/Mod/Fem/femguiutils/selection_widgets.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Mod/Fem/femguiutils/selection_widgets.py b/src/Mod/Fem/femguiutils/selection_widgets.py index 18ea208bbc..12986efacc 100644 --- a/src/Mod/Fem/femguiutils/selection_widgets.py +++ b/src/Mod/Fem/femguiutils/selection_widgets.py @@ -479,12 +479,12 @@ class GeometryElementsSelection(QtGui.QWidget): self.sel_server = FemSelectionObserver(self.selectionParser, print_message) def selectionParser(self, selection): - FreeCAD.Console.PrintMessage("Selection: {} {} {}\n".format( - selection[0].Shape.ShapeType, - selection[0].Name, - selection[1] - )) if hasattr(selection[0], "Shape") and selection[1]: + FreeCAD.Console.PrintMessage("Selection: {} {} {}\n".format( + selection[0].Shape.ShapeType, + selection[0].Name, + selection[1] + )) sobj = selection[0] elt = sobj.Shape.getElement(selection[1]) ele_ShapeType = elt.ShapeType