From 3a1252fab5a800532ed287d31b09bb5c48575d14 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 41535c40d9..bd1bbd253a 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 @@ -1058,7 +1058,16 @@ public List getFrames() throws ExtractionException { 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 result = new ArrayList<>(spec.length - 1);