From 17ccaf4b877399de28609b9279ca4c3123bdb13a Mon Sep 17 00:00:00 2001 From: litetex <40789489+litetex@users.noreply.github.com> Date: Tue, 8 Jun 2021 20:30:13 +0200 Subject: [PATCH] Update YoutubeStreamExtractor.java To fix ``java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String[] java.lang.String.split(java.lang.String)' on a null object reference`` --- .../youtube/extractors/YoutubeStreamExtractor.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeStreamExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeStreamExtractor.java index ad2b1f7db..a5b809370 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeStreamExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeStreamExtractor.java @@ -1049,7 +1049,16 @@ public class YoutubeStreamExtractor extends StreamExtractor { storyboardsRenderer = storyboards.getObject("playerStoryboardSpecRenderer"); } - final String[] spec = storyboardsRenderer.getString("spec").split("\\|"); + if (storyboardsRenderer == null) { + return new ArrayList<>(); + } + + final String storyboardsRendererSpec = storyboardsRenderer.getString("spec"); + if (storyboardsRendererSpec == null) { + return new ArrayList<>(); + } + + final String[] spec = storyboardsRendererSpec.split("\\|"); final String url = spec[0]; final ArrayList