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.
This commit is contained in:
Juan Jesús Alejo Sillero
2025-04-26 01:15:45 +02:00
committed by GitHub
parent d9ab28d884
commit cee11e6ebd
+2
View File
@@ -360,6 +360,8 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
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)