Skip to content

Commit 5bb2e83

Browse files
shockdesigngrabbou
authored andcommitted
Switch equality check in BlobModule.java
Summary: Switch the equality check to avoid crash on the first item. The check can be on a null object and return the correct result. Fixes facebook#18709 Just a simple switch on equals, to make sure we're not bombing out by having a null scheme. No related PRs and does not require a document change. [ANDROID][BUGFIX][BlobModule] Switch equality check in BlobModule.java Closes facebook#18893 Differential Revision: D7658036 Pulled By: hramos fbshipit-source-id: db61b98dae178dbbb645070f7b0d73ab43d30541
1 parent f8091fa commit 5bb2e83

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ReactAndroid/src/main/java/com/facebook/react/modules/blob/BlobModule.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public void onMessage(ByteString bytes, WritableMap params) {
7979
@Override
8080
public boolean supports(Uri uri, String responseType) {
8181
String scheme = uri.getScheme();
82-
boolean isRemote = scheme.equals("http") || scheme.equals("https");
82+
boolean isRemote = "http".equals(scheme) || "https".equals(scheme);
8383

8484
return (!isRemote && responseType.equals("blob"));
8585
}

0 commit comments

Comments
 (0)