From 0ec9f3835f49ccbd97079f208d71017c96427756 Mon Sep 17 00:00:00 2001 From: Baris Soner Usakli Date: Sun, 16 Feb 2014 12:15:20 -0500 Subject: [PATCH] fixed js error in composer --- public/src/modules/composer.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/public/src/modules/composer.js b/public/src/modules/composer.js index cc4a156cc0..71ab3011af 100644 --- a/public/src/modules/composer.js +++ b/public/src/modules/composer.js @@ -552,13 +552,15 @@ define(['taskbar'], function(taskbar) { if(items && items.length) { var blob = items[0].getAsFile(); - blob.name = 'upload-'+ utils.generateUUID(); + if(blob) { + blob.name = 'upload-'+ utils.generateUUID(); - var fd = new FormData(); - fd.append('files[]', blob, blob.name); + var fd = new FormData(); + fd.append('files[]', blob, blob.name); - fileForm[0].reset(); - uploadSubmit([blob], post_uuid, '/api/post/upload', fd); + fileForm[0].reset(); + uploadSubmit([blob], post_uuid, '/api/post/upload', fd); + } } }); }