mirror of
https://github.com/jellyfin/jellyfin-androidtv.git
synced 2025-05-17 19:36:03 +08:00
Fix crash in CustomPlaybackOverlayFragment.prepareChannelAdapter when Live TV channels are not loaded
This commit is contained in:

committed by
Niels van Velzen

parent
fa83fc1b30
commit
b22d45816e
@ -1277,8 +1277,10 @@ public class CustomPlaybackOverlayFragment extends Fragment implements LiveTvGui
|
||||
private void prepareChannelAdapter() {
|
||||
// create quick channel change row
|
||||
TvManager.loadAllChannels(this, response -> {
|
||||
List<BaseItemDto> channels = TvManager.getAllChannels();
|
||||
if (channels == null) return null;
|
||||
ArrayObjectAdapter channelAdapter = new ArrayObjectAdapter(new ChannelCardPresenter());
|
||||
channelAdapter.addAll(0, TvManager.getAllChannels());
|
||||
channelAdapter.addAll(0, channels);
|
||||
if (mChapterRow != null) mPopupRowAdapter.remove(mChapterRow);
|
||||
mChapterRow = new ListRow(new HeaderItem(requireContext().getString(R.string.channels)), channelAdapter);
|
||||
mPopupRowAdapter.add(mChapterRow);
|
||||
|
Reference in New Issue
Block a user