Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ public void run() {

// find cached result if `key` property exists
String cacheKey = this.taskId;
String ext = this.options.appendExt.isEmpty() ? "" : "." + this.options.appendExt;
String ext = (this.options.appendExt == null || this.options.appendExt.isEmpty()) ? "" : "." + this.options.appendExt;

if (this.options.key != null) {
cacheKey = ReactNativeBlobUtilUtils.getMD5(this.options.key);
Expand Down Expand Up @@ -402,7 +402,7 @@ else if (value.equalsIgnoreCase("utf8"))

if (rawRequestBodyArray != null) {
requestType = RequestType.Form;
} else if (cType.isEmpty()) {
} else if (cType == null || cType.isEmpty()) {
if (!cType.equalsIgnoreCase("")) {
builder.header("Content-Type", "application/octet-stream");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class MimeType {
public static String getFullFileName(String name, String mimeType) {
// Prior to API 29, MimeType.BINARY_FILE has no file extension
String ext = MimeType.getExtensionFromMimeType(mimeType);
if (ext.isEmpty() || name.endsWith("." + "ext")) return name;
if ((ext == null || ext.isEmpty()) || name.endsWith("." + "ext")) return name;
else {
String fn = name + "." + ext;
if (fn.endsWith(".")) return StringUtils.stripEnd(fn, ".");
Expand Down