From 621996289212694f37c7e6513d215818940d2b6b Mon Sep 17 00:00:00 2001 From: Sheogorath Date: Sun, 18 Mar 2018 03:06:11 +0100 Subject: Reorganize usage of `getAsFile()` Signed-off-by: Sheogorath --- public/vendor/inlineAttachment/inline-attachment.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'public') diff --git a/public/vendor/inlineAttachment/inline-attachment.js b/public/vendor/inlineAttachment/inline-attachment.js index e927c428..5c7c7166 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); + } } } } -- cgit v1.2.3