From 4c4c21342de6669d8463685658fb94db584efbb9 Mon Sep 17 00:00:00 2001 From: ansuz Date: Fri, 12 May 2017 16:26:51 +0200 Subject: [PATCH] don't try to decrypt nothing --- www/file/main.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/www/file/main.js b/www/file/main.js index 9c76e3618..e6ab7990c 100644 --- a/www/file/main.js +++ b/www/file/main.js @@ -180,6 +180,10 @@ define([ var cryptKey = secret.keys && secret.keys.fileKeyStr; var key = Nacl.util.decodeBase64(cryptKey); + if (!u8 || !u8.length) { + return void Cryptpad.errorLoadingScreen(e); + } + FileCrypto.decrypt(u8, key, function (e, data) { if (e) { Cryptpad.removeLoadingScreen();