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

Commit e5a2d5a

Browse files
bluemarvinMortimerGoro
authored andcommitted
Fix java.lang.NullPointerException in checkYoutubeOverride (#1437)
1 parent c81f61c commit e5a2d5a

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

app/src/common/shared/org/mozilla/vrbrowser/browser/SessionStore.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1113,14 +1113,20 @@ else if (aRequest.triggerUri != null)
11131113
private String checkYoutubeOverride(String aUri) {
11141114
try {
11151115
Uri uri = Uri.parse(aUri);
1116+
if (uri.getHost() == null) {
1117+
return null;
1118+
}
11161119
String hostLower = uri.getHost().toLowerCase();
11171120
if (!hostLower.endsWith(".youtube.com") && !hostLower.endsWith(".youtube-nocookie.com")) {
11181121
return null;
11191122
}
11201123

11211124
Uri.Builder uriBuilder = uri.buildUpon();
1122-
Boolean updateUri = false;
1125+
boolean updateUri = false;
11231126

1127+
if (uri.getScheme() == null) {
1128+
return null;
1129+
}
11241130
if (!uri.getScheme().equalsIgnoreCase("https")) {
11251131
uriBuilder.scheme("https");
11261132
updateUri = true;

0 commit comments

Comments
 (0)