From 4336190b5e90427c30e739f6125ba424235c32b9 Mon Sep 17 00:00:00 2001 From: Brett Sun Date: Fri, 13 Nov 2015 12:10:51 +0100 Subject: [PATCH] Fix FineUploader to handle cancellations in the onError() callback MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Calling cancel() in the onError() callback would cause an error as the upload handler tries to clear the upload’s xhr requests after cancel already clears them. --- js/components/ascribe_uploader/vendor/s3.fine-uploader.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/components/ascribe_uploader/vendor/s3.fine-uploader.js b/js/components/ascribe_uploader/vendor/s3.fine-uploader.js index 5b90cf5a..ae2ed1df 100644 --- a/js/components/ascribe_uploader/vendor/s3.fine-uploader.js +++ b/js/components/ascribe_uploader/vendor/s3.fine-uploader.js @@ -4399,7 +4399,9 @@ qq.UploadHandlerController = function(o, namespace) { } ) .done(function() { - handler.clearXhr(id, chunkIdx); + if (handler._getFileState(id)) { + handler.clearXhr(id, chunkIdx); + } }) ; } }