From 621996289212694f37c7e6513d215818940d2b6b Mon Sep 17 00:00:00 2001 From: Sheogorath Date: Sun, 18 Mar 2018 03:06:11 +0100 Subject: [PATCH] Reorganize usage of `getAsFile()` Signed-off-by: Sheogorath --- public/vendor/inlineAttachment/inline-attachment.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/public/vendor/inlineAttachment/inline-attachment.js b/public/vendor/inlineAttachment/inline-attachment.js index e927c42..5c7c716 100644 --- a/public/vendor/inlineAttachment/inline-attachment.js +++ b/public/vendor/inlineAttachment/inline-attachment.js @@ -370,8 +370,11 @@ if (this.isFileAllowed(item)) { result = true; var id = ID(); - this.onFileInserted(item.getAsFile(), id); - this.uploadFile(item.getAsFile(), id); + var file = item.getAsFile(); + if (file !== null) { + this.onFileInserted(file, id); + this.uploadFile(file, id); + } } } }