mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-04 11:11:39 +00:00
Fix null checking
This commit is contained in:
parent
aa10a68a86
commit
3801b55abf
2 changed files with 6 additions and 8 deletions
|
|
@ -72,8 +72,7 @@ public class ArtistRepository {
|
|||
if (random) {
|
||||
Collections.shuffle(artists);
|
||||
getArtistInfo(artists.subList(0, artists.size() / size > 0 ? size : artists.size()), listLiveArtists);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
listLiveArtists.setValue(artists);
|
||||
}
|
||||
}
|
||||
|
|
@ -146,7 +145,7 @@ public class ArtistRepository {
|
|||
.enqueue(new Callback<SubsonicResponse>() {
|
||||
@Override
|
||||
public void onResponse(Call<SubsonicResponse> call, Response<SubsonicResponse> response) {
|
||||
artistFullInfo.setValue(MappingUtil.mapArtist(response.body().getArtistInfo2()));
|
||||
if (response.body().getArtistInfo2() != null) artistFullInfo.setValue(MappingUtil.mapArtist(response.body().getArtistInfo2()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -113,13 +113,12 @@ public class ArtistPageFragment extends Fragment {
|
|||
}
|
||||
|
||||
private void initArtistInfo() {
|
||||
|
||||
artistPageViewModel.getArtistInfo(artistPageViewModel.getArtist().getId()).observe(requireActivity(), artist -> {
|
||||
if (bind != null) bind.artistPageBioSector.setVisibility(artist.getBio() != null ? View.VISIBLE : View.GONE);
|
||||
if (bind != null) bind.bioMoreTextViewClickable.setVisibility(artist.getLastfm() != null ? View.VISIBLE : View.GONE);
|
||||
|
||||
CustomGlideRequest.Builder
|
||||
.from(requireContext(), null, CustomGlideRequest.ARTIST_PIC, artist.getImageUrl())
|
||||
.from(requireContext(), /*artistPageViewModel.getArtist().getId()*/ null, CustomGlideRequest.ARTIST_PIC, artist.getImageUrl())
|
||||
.build()
|
||||
.into(bind.artistBackdropImageView);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue