Fix potential bug in get_selected_playlistrows()
It was possible for the returned list to have embedded None objects
This commit is contained in:
parent
c93f24970f
commit
a41aea2d36
@ -594,8 +594,8 @@ class PlaylistTab(QTableWidget):
|
||||
|
||||
return [self._get_playlistrow_id(a) for a in self._get_selected_rows()]
|
||||
|
||||
def get_selected_playlistrows(self,
|
||||
session: scoped_session) -> Optional[List]:
|
||||
def get_selected_playlistrows(
|
||||
self, session: scoped_session) -> Optional[List[PlaylistRows]]:
|
||||
"""
|
||||
Return a list of PlaylistRows of the selected rows
|
||||
"""
|
||||
@ -603,7 +603,9 @@ class PlaylistTab(QTableWidget):
|
||||
plr_ids = self.get_selected_playlistrow_ids()
|
||||
if not plr_ids:
|
||||
return None
|
||||
return [session.get(PlaylistRows, a) for a in plr_ids]
|
||||
plrs = [session.get(PlaylistRows, a) for a in plr_ids]
|
||||
|
||||
return [plr for plr in plrs if plr is not None]
|
||||
|
||||
def insert_header(self, session: scoped_session, note: str,
|
||||
repaint: bool = True) -> None:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user