From 5bb2e83f65dfe8b6d016ab03a2e8f08221876cf2 Mon Sep 17 00:00:00 2001 From: shockdesign Date: Tue, 17 Apr 2018 13:21:09 -0700 Subject: [PATCH] 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 #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 https://github.com/facebook/react-native/pull/18893 Differential Revision: D7658036 Pulled By: hramos fbshipit-source-id: db61b98dae178dbbb645070f7b0d73ab43d30541 --- .../main/java/com/facebook/react/modules/blob/BlobModule.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/modules/blob/BlobModule.java b/ReactAndroid/src/main/java/com/facebook/react/modules/blob/BlobModule.java index 0c2adc91d..ee62d2cd2 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/modules/blob/BlobModule.java +++ b/ReactAndroid/src/main/java/com/facebook/react/modules/blob/BlobModule.java @@ -79,7 +79,7 @@ public class BlobModule extends ReactContextBaseJavaModule { @Override public boolean supports(Uri uri, String responseType) { String scheme = uri.getScheme(); - boolean isRemote = scheme.equals("http") || scheme.equals("https"); + boolean isRemote = "http".equals(scheme) || "https".equals(scheme); return (!isRemote && responseType.equals("blob")); }