fix: null checking

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

View file

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