Skip to content

Commit 536365c

Browse files
authored
Merge pull request #142 from yausername/serviceByUrlNPEfix
fix npe in fetching service by url
2 parents 8425936 + 16d693e commit 536365c

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

extractor/src/main/java/org/schabi/newpipe/extractor/StreamingService.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -308,11 +308,11 @@ public final LinkType getLinkTypeByUrl(String url) throws ParsingException {
308308
LinkHandlerFactory cH = getChannelLHFactory();
309309
LinkHandlerFactory pH = getPlaylistLHFactory();
310310

311-
if (sH.acceptUrl(url)) {
311+
if (sH != null && sH.acceptUrl(url)) {
312312
return LinkType.STREAM;
313-
} else if (cH.acceptUrl(url)) {
313+
} else if (cH != null && cH.acceptUrl(url)) {
314314
return LinkType.CHANNEL;
315-
} else if (pH.acceptUrl(url)) {
315+
} else if (pH != null && pH.acceptUrl(url)) {
316316
return LinkType.PLAYLIST;
317317
} else {
318318
return LinkType.NONE;

0 commit comments

Comments
 (0)