CB-6503: Null pointer check for headers in upload (This closes #27)

This commit is contained in:
Ian Clelland
2014-07-08 12:51:44 -04:00
parent 04f088b6c9
commit 7591ab84b5
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -343,7 +343,7 @@ public class FileTransfer extends CordovaPlugin {
conn.setRequestMethod(httpMethod);
// if we specified a Content-Type header, don't do multipart form upload
boolean multipartFormUpload = !headers.has("Content-Type");
boolean multipartFormUpload = (headers == null) || !headers.has("Content-Type");
if (multipartFormUpload) {
conn.setRequestProperty("Content-Type", "multipart/form-data; boundary=" + BOUNDARY);
}