Null checking

This commit is contained in:
CappielloAntonio 2022-01-10 12:41:59 +01:00
parent 856cc04d4d
commit a668236202

View file

@ -45,11 +45,13 @@ public class PlayerLyricsFragment extends Fragment {
private void initLyrics() { private void initLyrics() {
playerBottomSheetViewModel.getLiveLyrics().observe(requireActivity(), lyrics -> { playerBottomSheetViewModel.getLiveLyrics().observe(requireActivity(), lyrics -> {
if (bind != null) {
if (lyrics == null || lyrics.trim().equals("")) { if (lyrics == null || lyrics.trim().equals("")) {
bind.nowPlayingSongLyricsTextView.setText(R.string.player_song_lyrics_none_available_label); bind.nowPlayingSongLyricsTextView.setText(R.string.player_song_lyrics_none_available_label);
} else { } else {
bind.nowPlayingSongLyricsTextView.setText(MusicUtil.getReadableString(lyrics)); bind.nowPlayingSongLyricsTextView.setText(MusicUtil.getReadableString(lyrics));
} }
}
}); });
} }
} }