|
17 | 17 | import org.schabi.newpipe.extractor.channel.tabs.ChannelTabInfo; |
18 | 18 | import org.schabi.newpipe.extractor.exceptions.ParsingException; |
19 | 19 | import org.schabi.newpipe.extractor.linkhandler.ListLinkHandler; |
| 20 | +import org.schabi.newpipe.extractor.linkhandler.ListLinkHandlerFactory; |
20 | 21 | import org.schabi.newpipe.extractor.linkhandler.ReadyChannelTabListLinkHandler; |
21 | 22 | import org.schabi.newpipe.extractor.stream.StreamInfoItem; |
22 | 23 | import org.schabi.newpipe.fragments.list.BaseListInfoFragment; |
@@ -128,10 +129,13 @@ public void handleResult(@NonNull final ChannelTabInfo result) { |
128 | 129 | // once `handleResult` is called, the parsed data was already saved to cache, so |
129 | 130 | // we can discard any raw data in ReadyChannelTabListLinkHandler and create a |
130 | 131 | // link handler with identical properties, but without any raw data |
131 | | - tabHandler = result.getService() |
132 | | - .getChannelTabLHFactory() |
133 | | - .fromQuery(tabHandler.getId(), tabHandler.getContentFilters(), |
134 | | - tabHandler.getSortFilter()); |
| 132 | + final ListLinkHandlerFactory channelTabLHFactory = result.getService() |
| 133 | + .getChannelTabLHFactory(); |
| 134 | + if (channelTabLHFactory != null) { |
| 135 | + // some services do not not have a ChannelTabLHFactory |
| 136 | + tabHandler = channelTabLHFactory.fromQuery(tabHandler.getId(), |
| 137 | + tabHandler.getContentFilters(), tabHandler.getSortFilter()); |
| 138 | + } |
135 | 139 | } catch (final ParsingException e) { |
136 | 140 | // silently ignore the error, as the app can continue to function normally |
137 | 141 | Log.w(TAG, "Could not recreate channel tab handler", e); |
|
0 commit comments