From 9eff18252b4e0912fb0be7b616588b806ec31805 Mon Sep 17 00:00:00 2001 From: Ritvik Saraf <13ritvik@gmail.com> Date: Thu, 28 Feb 2019 22:55:18 +0530 Subject: [PATCH] fix npe in fetching service by url --- .../java/org/schabi/newpipe/extractor/StreamingService.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/StreamingService.java b/extractor/src/main/java/org/schabi/newpipe/extractor/StreamingService.java index 86bd9d1f8..26e84da97 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/StreamingService.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/StreamingService.java @@ -308,11 +308,11 @@ public abstract class StreamingService { LinkHandlerFactory cH = getChannelLHFactory(); LinkHandlerFactory pH = getPlaylistLHFactory(); - if (sH.acceptUrl(url)) { + if (sH != null && sH.acceptUrl(url)) { return LinkType.STREAM; - } else if (cH.acceptUrl(url)) { + } else if (cH != null && cH.acceptUrl(url)) { return LinkType.CHANNEL; - } else if (pH.acceptUrl(url)) { + } else if (pH != null && pH.acceptUrl(url)) { return LinkType.PLAYLIST; } else { return LinkType.NONE;