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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user