Skip to content

Commit

Permalink
Update YoutubeStreamExtractor.java
Browse files Browse the repository at this point in the history
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``
  • Loading branch information
litetex committed Jun 20, 2021
1 parent 1b32598 commit 1ba3230
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1058,7 +1058,16 @@ public List<Frameset> 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<Frameset> result = new ArrayList<>(spec.length - 1);

Expand Down

0 comments on commit 1ba3230

Please sign in to comment.