mirror of
https://github.com/antebudimir/tempus.git
synced 2025-12-31 09:33:33 +00:00
fix: Crash when trying to add to an empty playlist
This commit is contained in:
parent
9736890e3c
commit
2acf11023a
1 changed files with 4 additions and 2 deletions
|
|
@ -38,8 +38,10 @@ public class PlaylistChooserViewModel extends AndroidViewModel {
|
|||
List<String> songIds = Lists.transform(toAdd, Child::getId);
|
||||
if (skipDuplicates) {
|
||||
playlistRepository.getPlaylistSongs(playlistId).observe(owner, playlistSongs -> {
|
||||
List<String> playlistSongIds = Lists.transform(playlistSongs, Child::getId);
|
||||
songIds.removeAll(playlistSongIds);
|
||||
if (playlistSongs != null) {
|
||||
List<String> playlistSongIds = Lists.transform(playlistSongs, Child::getId);
|
||||
songIds.removeAll(playlistSongIds);
|
||||
}
|
||||
playlistRepository.addSongToPlaylist(playlistId, new ArrayList<>(songIds));
|
||||
dialog.dismiss();
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue