Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
Fix java.lang.NullPointerException in checkYoutubeOverride (#1437)
Browse files Browse the repository at this point in the history
  • Loading branch information
bluemarvin authored and MortimerGoro committed Jul 22, 2019
1 parent c81f61c commit e5a2d5a
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1113,14 +1113,20 @@ else if (aRequest.triggerUri != null)
private String checkYoutubeOverride(String aUri) {
try {
Uri uri = Uri.parse(aUri);
if (uri.getHost() == null) {
return null;
}
String hostLower = uri.getHost().toLowerCase();
if (!hostLower.endsWith(".youtube.com") && !hostLower.endsWith(".youtube-nocookie.com")) {
return null;
}

Uri.Builder uriBuilder = uri.buildUpon();
Boolean updateUri = false;
boolean updateUri = false;

if (uri.getScheme() == null) {
return null;
}
if (!uri.getScheme().equalsIgnoreCase("https")) {
uriBuilder.scheme("https");
updateUri = true;
Expand Down

0 comments on commit e5a2d5a

Please sign in to comment.