From cee11e6ebd92d74d8606f4343b472d8ff6784955 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Jes=C3=BAs=20Alejo=20Sillero?= Date: Sat, 26 Apr 2025 01:15:45 +0200 Subject: [PATCH] Fix: Prevent UnboundLocalError in on_populate_tree_lists - Added a safeguard to skip items in `user_lists` that do not match expected types (`UserPlaylist`, `Playlist`, or `Mix`). - Ensured `twi_child` is only accessed when properly initialized. - This prevents crashes during GUI interaction when unexpected data is encountered. --- tidal_dl_ng/gui.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tidal_dl_ng/gui.py b/tidal_dl_ng/gui.py index 870b658..5ec0b13 100644 --- a/tidal_dl_ng/gui.py +++ b/tidal_dl_ng/gui.py @@ -360,6 +360,8 @@ def on_populate_tree_lists(self, user_lists: [Playlist | UserPlaylist | Mix]): twi_child = QtWidgets.QTreeWidgetItem(twi_mixes) name: str = item.title info: str = item.sub_title + else: + continue twi_child.setText(0, name) set_user_list_media(twi_child, item)