Skip to content

Commit

Permalink
check for FormData before using it
Browse files Browse the repository at this point in the history
  • Loading branch information
sheppard committed Jul 9, 2015
1 parent d3cbd74 commit 2c34f05
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion js/wq/outbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ function _Outbox(store) {
}

// If files/blobs are present, use a FormData object to submit
var formData = new FormData();
var formData = (window.FormData && new FormData());
var useFormData = false;
var key, val, blob, slice;
for (key in data) {
Expand All @@ -184,6 +184,9 @@ function _Outbox(store) {
}
}
if (useFormData) {
if (!formData) {
throw "FormData needed but not present!";
}
for (key in data) {
val = data[key];
if (json.isArray(val)) {
Expand Down

0 comments on commit 2c34f05

Please sign in to comment.