From 5afb3f7893507c1a0016860a3af8970c8e180224 Mon Sep 17 00:00:00 2001 From: ansuz Date: Mon, 27 Sep 2021 14:43:46 +0530 Subject: [PATCH] guard against typeError when importing sheets --- www/common/media-tag.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/www/common/media-tag.js b/www/common/media-tag.js index a99a74f8f..133e64805 100644 --- a/www/common/media-tag.js +++ b/www/common/media-tag.js @@ -82,7 +82,11 @@ var factory = function () { plainText.innerText = e.srcElement.result; cb(void 0, plainText); }); - reader.readAsText(content); + try { + reader.readAsText(content); + } catch (err) { + cb(err); + } }, image: function (metadata, url, content, cfg, cb) { var img = document.createElement('img');