- fixed a bug that when a Gerber object is edited and it has as solid_geometry a single Polygon, saving the result was failing due of len() function not working on a single Polygon

This commit is contained in:
Marius Stanciu
2019-10-04 21:11:02 +03:00
committed by Marius
parent 01a9763ad6
commit ba549705a2
2 changed files with 12 additions and 5 deletions

View File

@@ -3229,10 +3229,16 @@ class App(QtCore.QObject):
self.grb_editor.deactivate_grb_editor()
# delete the old object (the source object) if it was an empty one
if len(edited_obj.solid_geometry) == 0:
old_name = edited_obj.options['name']
self.collection.set_active(old_name)
self.collection.delete_active()
try:
if len(edited_obj.solid_geometry) == 0:
old_name = edited_obj.options['name']
self.collection.set_active(old_name)
self.collection.delete_active()
except TypeError:
# if the solid_geometry is a single Polygon the len() will not work
# in any case, falling here means that we have something in the solid_geometry, even if only
# a single Polygon, therefore we pass this
pass
# restore GUI to the Selected TAB
# Remove anything else in the GUI