Fix crash in CustomPlaybackOverlayFragment.prepareChannelAdapter when Live TV channels are not loaded

This commit is contained in:
Niels van Velzen
2025-04-20 22:18:47 +02:00
committed by Niels van Velzen
parent fa83fc1b30
commit b22d45816e

View File

@ -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);