1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2025-10-25 04:17:39 +00:00

Fix error detection when loading main page tabs

Do not crash if something unexpected happens.
This commit is contained in:
tobigr
2025-07-18 19:06:26 +02:00
committed by TobiGr
parent 941f85781b
commit fe58ec85ed

View File

@@ -37,7 +37,6 @@ import org.schabi.newpipe.BaseFragment;
import org.schabi.newpipe.R;
import org.schabi.newpipe.databinding.FragmentMainBinding;
import org.schabi.newpipe.error.ErrorUtil;
import org.schabi.newpipe.extractor.exceptions.ExtractionException;
import org.schabi.newpipe.local.playlist.LocalPlaylistFragment;
import org.schabi.newpipe.settings.tabs.Tab;
import org.schabi.newpipe.settings.tabs.TabsManager;
@@ -303,8 +302,9 @@ public class MainFragment extends BaseFragment implements TabLayout.OnTabSelecte
final Fragment fragment;
try {
fragment = tab.getFragment(context);
} catch (final ExtractionException e) {
} catch (final Exception e) {
ErrorUtil.showUiErrorSnackbar(context, "Getting fragment item", e);
// TODO: show an error fragment instead
return new BlankFragment();
}