Null checking

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

View file

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