From 6dc3c62ba46fed98386368509d0ce071ebc118b3 Mon Sep 17 00:00:00 2001 From: ansuz Date: Mon, 22 May 2017 15:12:39 +0200 Subject: [PATCH] check for src before trying to ajax --- www/file/file-crypto.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/www/file/file-crypto.js b/www/file/file-crypto.js index 61e11ecdc..49ced7553 100644 --- a/www/file/file-crypto.js +++ b/www/file/file-crypto.js @@ -112,6 +112,11 @@ define([ }; var fetchDecryptedMetadata = function (src, key, cb) { + if (typeof(src) !== 'string') { + return window.setTimeout(function () { + cb('NO_SOURCE'); + }); + } fetchMetadata(src, function (e, buffer) { if (e) { return cb(e); } cb(void 0, decryptMetadata(buffer, key));