mirror of
https://github.com/wassname/sloth.git
synced 2026-07-01 06:52:00 +08:00
Avoid error message when current item in treeview is reset
This commit is contained in:
@@ -284,6 +284,8 @@ class LabelTool(QObject):
|
||||
def setCurrentImage(self, image):
|
||||
if isinstance(image, QModelIndex):
|
||||
image = self._model.itemFromIndex(image)
|
||||
if isinstance(image, RootModelItem):
|
||||
return
|
||||
while (image is not None) and (not isinstance(image, ImageModelItem)):
|
||||
image = image.parent()
|
||||
if image is None:
|
||||
|
||||
Reference in New Issue
Block a user