From 4aa8d92a5349933607e8ec95d2850781bf372f29 Mon Sep 17 00:00:00 2001 From: ansuz Date: Thu, 21 Dec 2017 17:18:10 +0100 Subject: [PATCH 1/2] handle errors when constructing thumbnails from file metadata --- www/common/common-thumbnail.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/www/common/common-thumbnail.js b/www/common/common-thumbnail.js index ce77ce92f..18e5dff52 100644 --- a/www/common/common-thumbnail.js +++ b/www/common/common-thumbnail.js @@ -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'; From 892dfb18f7d031d6aa2f93a5c2f165972cdd7832 Mon Sep 17 00:00:00 2001 From: ansuz Date: Thu, 21 Dec 2017 17:30:54 +0100 Subject: [PATCH 2/2] check if users have service workers --- www/common/cryptpad-common.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/www/common/cryptpad-common.js b/www/common/cryptpad-common.js index 0a2ead8f0..a06d77077 100644 --- a/www/common/cryptpad-common.js +++ b/www/common/cryptpad-common.js @@ -703,6 +703,9 @@ define([ if (typeof(Worker) === "undefined") { Feedback.send('NO_WEBWORKER'); } + if (typeof(ServiceWorker) === "undefined") { + Feedback.send('NO_SERVICEWORKER'); + } Feedback.reportScreenDimensions(); Feedback.reportLanguage();