File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
android/src/main/java/com/ReactNativeBlobUtil Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -297,7 +297,7 @@ public void run() {
297
297
298
298
// find cached result if `key` property exists
299
299
String cacheKey = this .taskId ;
300
- String ext = this .options .appendExt . isEmpty () ? "" : "." + this .options .appendExt ;
300
+ String ext = ( this .options .appendExt == null || this . options . appendExt . isEmpty () ) ? "" : "." + this .options .appendExt ;
301
301
302
302
if (this .options .key != null ) {
303
303
cacheKey = ReactNativeBlobUtilUtils .getMD5 (this .options .key );
@@ -402,7 +402,7 @@ else if (value.equalsIgnoreCase("utf8"))
402
402
403
403
if (rawRequestBodyArray != null ) {
404
404
requestType = RequestType .Form ;
405
- } else if (cType .isEmpty ()) {
405
+ } else if (cType == null || cType .isEmpty ()) {
406
406
if (!cType .equalsIgnoreCase ("" )) {
407
407
builder .header ("Content-Type" , "application/octet-stream" );
408
408
}
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ public class MimeType {
27
27
public static String getFullFileName (String name , String mimeType ) {
28
28
// Prior to API 29, MimeType.BINARY_FILE has no file extension
29
29
String ext = MimeType .getExtensionFromMimeType (mimeType );
30
- if (ext .isEmpty () || name .endsWith ("." + "ext" )) return name ;
30
+ if (( ext == null || ext .isEmpty () ) || name .endsWith ("." + "ext" )) return name ;
31
31
else {
32
32
String fn = name + "." + ext ;
33
33
if (fn .endsWith ("." )) return StringUtils .stripEnd (fn , "." );
You can’t perform that action at this time.
0 commit comments