From f3678d4c0141cfb267ff61cc5d0b09099afcd54a Mon Sep 17 00:00:00 2001 From: Mario Voigt Date: Thu, 13 Aug 2020 14:47:06 +0200 Subject: [PATCH] update for migrategroups extension --- extensions/fablabchemnitz_migrategroups.inx | 2 +- extensions/fablabchemnitz_migrategroups.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/extensions/fablabchemnitz_migrategroups.inx b/extensions/fablabchemnitz_migrategroups.inx index a2ab7095..6f71587a 100644 --- a/extensions/fablabchemnitz_migrategroups.inx +++ b/extensions/fablabchemnitz_migrategroups.inx @@ -11,6 +11,6 @@ \ No newline at end of file diff --git a/extensions/fablabchemnitz_migrategroups.py b/extensions/fablabchemnitz_migrategroups.py index fe57dbd5..cc5e57f4 100644 --- a/extensions/fablabchemnitz_migrategroups.py +++ b/extensions/fablabchemnitz_migrategroups.py @@ -57,8 +57,9 @@ class MigrateGroups(inkex.Effect): group.getparent().remove(group) #remove the selected, now empty group (if it's the case) - if self.svg.selected[0].tag == inkex.addNS('g','svg'): - self.svg.selected[0].getparent().remove(self.svg.selected[0]) + if len(self.svg.selected) > 0: + if self.svg.selected[0].tag == inkex.addNS('g','svg'): + self.svg.selected[0].getparent().remove(self.svg.selected[0]) #TODO: make newGroup selected now. How ? MigrateGroups().run() \ No newline at end of file