fix: null checking

This commit is contained in:
antonio 2023-08-16 23:48:14 +02:00
parent a50fc74117
commit b8b9c80bdc

View file

@ -63,9 +63,11 @@ public class ArtistRepository {
if (response.isSuccessful() && response.body() != null) { if (response.isSuccessful() && response.body() != null) {
List<ArtistID3> artists = new ArrayList<>(); List<ArtistID3> artists = new ArrayList<>();
if(response.body().getSubsonicResponse().getArtists() != null) {
for (IndexID3 index : response.body().getSubsonicResponse().getArtists().getIndices()) { for (IndexID3 index : response.body().getSubsonicResponse().getArtists().getIndices()) {
artists.addAll(index.getArtists()); artists.addAll(index.getArtists());
} }
}
if (random) { if (random) {
Collections.shuffle(artists); Collections.shuffle(artists);