From 844c4d15e977b5a657cb908934b2745c84fcadd6 Mon Sep 17 00:00:00 2001 From: El RIDO Date: Sat, 19 Sep 2015 14:19:42 +0200 Subject: [PATCH] fixes #30 --- js/zerobin.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/zerobin.js b/js/zerobin.js index c5f1d0d7..22689c96 100644 --- a/js/zerobin.js +++ b/js/zerobin.js @@ -851,7 +851,8 @@ $(function() { sendData: function(event) { event.preventDefault(); - var files = document.getElementById('file').files; // FileList object + var file = document.getElementById('file'), + files = (file && file.files) ? file.files : null; // FileList object // Do not send if no data. if (this.message.val().length == 0 && !(files && files[0])) return;