From 1a75369591f48d7aa7919c553e49a0d9a88f8fec Mon Sep 17 00:00:00 2001 From: antonio Date: Thu, 31 Aug 2023 15:58:00 +0200 Subject: [PATCH] fix: null checking --- .../cappielloantonio/tempo/repository/ArtistRepository.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/cappielloantonio/tempo/repository/ArtistRepository.java b/app/src/main/java/com/cappielloantonio/tempo/repository/ArtistRepository.java index 334797ca..f39dbffa 100644 --- a/app/src/main/java/com/cappielloantonio/tempo/repository/ArtistRepository.java +++ b/app/src/main/java/com/cappielloantonio/tempo/repository/ArtistRepository.java @@ -63,9 +63,11 @@ public class ArtistRepository { if (response.isSuccessful() && response.body() != null) { List artists = new ArrayList<>(); - if(response.body().getSubsonicResponse().getArtists() != null) { + if(response.body().getSubsonicResponse().getArtists() != null && response.body().getSubsonicResponse().getArtists().getIndices() != null) { for (IndexID3 index : response.body().getSubsonicResponse().getArtists().getIndices()) { - artists.addAll(index.getArtists()); + if(index != null && index.getArtists() != null) { + artists.addAll(index.getArtists()); + } } }