From aef42d041451eb486dcc4bf701a8a3b18bdfbffc Mon Sep 17 00:00:00 2001 From: rnicholus Date: Tue, 10 Apr 2018 14:48:38 -0500 Subject: [PATCH] fix(upload.handler.controller): missing null-check in send() --- client/js/upload-handler/upload.handler.controller.js | 9 ++++++++- client/js/version.js | 2 +- package.json | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/client/js/upload-handler/upload.handler.controller.js b/client/js/upload-handler/upload.handler.controller.js index a8f8c2791..d83b524b3 100644 --- a/client/js/upload-handler/upload.handler.controller.js +++ b/client/js/upload-handler/upload.handler.controller.js @@ -393,7 +393,14 @@ qq.UploadHandlerController = function(o, namespace) { simple = { send: function(id, name) { - handler._getFileState(id).loaded = 0; + var fileState = handler._getFileState(id); + + if (!fileState) { + log("Ignoring send request as this upload may have been cancelled, File ID " + id, "warn"); + return; + } + + fileState.loaded = 0; log("Sending simple upload request for " + id); handler.uploadFile(id).then( diff --git a/client/js/version.js b/client/js/version.js index 84692e112..a3473dcf0 100644 --- a/client/js/version.js +++ b/client/js/version.js @@ -1,2 +1,2 @@ /*global qq */ -qq.version = "5.16.1"; +qq.version = "5.16.2"; diff --git a/package.json b/package.json index b45a17672..af1514059 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "title": "Fine Uploader", "main": "lib/traditional.js", "types" : "typescript/fine-uploader.d.ts", - "version": "5.16.1", + "version": "5.16.2", "description": "Multiple file upload plugin with progress-bar, drag-and-drop, direct-to-S3 & Azure uploading, client-side image scaling, preview generation, form support, chunking, auto-resume, and tons of other features.", "keywords": [ "amazon",