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() {
297297
298298 // find cached result if `key` property exists
299299 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 ;
301301
302302 if (this .options .key != null ) {
303303 cacheKey = ReactNativeBlobUtilUtils .getMD5 (this .options .key );
@@ -402,7 +402,7 @@ else if (value.equalsIgnoreCase("utf8"))
402402
403403 if (rawRequestBodyArray != null ) {
404404 requestType = RequestType .Form ;
405- } else if (cType .isEmpty ()) {
405+ } else if (cType == null || cType .isEmpty ()) {
406406 if (!cType .equalsIgnoreCase ("" )) {
407407 builder .header ("Content-Type" , "application/octet-stream" );
408408 }
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ public class MimeType {
2727 public static String getFullFileName (String name , String mimeType ) {
2828 // Prior to API 29, MimeType.BINARY_FILE has no file extension
2929 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 ;
3131 else {
3232 String fn = name + "." + ext ;
3333 if (fn .endsWith ("." )) return StringUtils .stripEnd (fn , "." );
You can’t perform that action at this time.
0 commit comments