From ac41094472dabc62db303eb0e74d51fb8dc80ef1 Mon Sep 17 00:00:00 2001 From: Aeeeeeep Date: Mon, 5 Dec 2022 15:35:59 +0800 Subject: [PATCH] fix press Ctrl+D with none label, the labelImg.py break down --- labelImg.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/labelImg.py b/labelImg.py index efd8a2976..8e031fb95 100755 --- a/labelImg.py +++ b/labelImg.py @@ -813,6 +813,9 @@ def shape_selection_changed(self, selected=False): self.actions.shapeFillColor.setEnabled(selected) def add_label(self, shape): + if shape is None: + # print('add empty label') + return shape.paint_label = self.display_label_option.isChecked() item = HashableQListWidgetItem(shape.label) item.setFlags(item.flags() | Qt.ItemIsUserCheckable)