handle errors when constructing thumbnails from file metadata

This commit is contained in:
ansuz 2017-12-21 17:18:10 +01:00
parent d1d75f2f25
commit 4aa8d92a53
1 changed files with 6 additions and 0 deletions

View File

@ -254,6 +254,12 @@ define([
var cryptKey = secret.keys && secret.keys.fileKeyStr;
var key = Nacl.util.decodeBase64(cryptKey);
FileCrypto.fetchDecryptedMetadata(src, key, function (e, metadata) {
if (e) {
if (e === 'XHR_ERROR') { return; }
return console.error(e);
}
if (!metadata) { return console.error("NO_METADATA"); }
var v = metadata.thumbnail;
if (!v) {
v = 'EMPTY';