From a20bfbf6c1286c8e36cf27019d6504a308e6ffb3 Mon Sep 17 00:00:00 2001 From: ansuz Date: Tue, 3 Aug 2021 12:15:30 +0530 Subject: [PATCH 1/4] lint compliance --- www/checkup/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/checkup/main.js b/www/checkup/main.js index 171b9ac3b..a1e458f34 100644 --- a/www/checkup/main.js +++ b/www/checkup/main.js @@ -906,7 +906,7 @@ define([ h('table', [ row(["Failed test number", obj.test + 1]), row(["Returned value", h('pre', code(printableValue))]), - ]), + ]) ), ]); }; From 22357f882b3f4e425277e95e92343901819a49c8 Mon Sep 17 00:00:00 2001 From: ansuz Date: Tue, 3 Aug 2021 12:17:42 +0530 Subject: [PATCH 2/4] guard against a type error in user-object when FILES_DATA doesn't exist --- www/common/userObject.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/www/common/userObject.js b/www/common/userObject.js index 9de3ea918..c3960ebfd 100644 --- a/www/common/userObject.js +++ b/www/common/userObject.js @@ -316,13 +316,24 @@ define([ // Get data from AllFiles (Cryptpad_RECENTPADS) var getFileData = exp.getFileData = function (file, editable) { if (!file) { return; } - var link = (files[STATIC_DATA] || {})[file]; + var link; + try { + link = (files[STATIC_DATA] || {})[file]; + } catch (err) { + console.error(err); + } if (link) { var _link = editable ? link : Util.clone(link); if (!editable) { _link.static = true; } return _link; } - var data = files[FILES_DATA][file] || {}; + var data; + try { + data = files[FILES_DATA][file] || {}; + } catch (err) { + console.error(err); + data = {}; + } if (!editable) { data = JSON.parse(JSON.stringify(data)); if (data.href && data.href.indexOf('#') === -1) { From 298d69e9144c4480aeeae609f400cce5c23cda36 Mon Sep 17 00:00:00 2001 From: ansuz Date: Tue, 3 Aug 2021 12:23:10 +0530 Subject: [PATCH 3/4] guard against another possible type error (in the user object) --- www/common/userObject.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/www/common/userObject.js b/www/common/userObject.js index c3960ebfd..9e033f5c0 100644 --- a/www/common/userObject.js +++ b/www/common/userObject.js @@ -367,8 +367,13 @@ define([ return '??'; } var data = getFileData(file); + if (!data) { + error("unable to retrieve data about the requested file: ", file, data); + return; + } + // handle links if (data.static) { return data.name; } - if (!file || !data || !(data.href || data.roHref)) { + if (!file || !(data.href || data.roHref)) { error("getTitle called with a non-existing file id: ", file, data); return; } From d8a7e4aa2a6b0d648c8d10a165f35e918519bd7a Mon Sep 17 00:00:00 2001 From: ansuz Date: Tue, 3 Aug 2021 12:35:02 +0530 Subject: [PATCH 4/4] update changelog --- CHANGELOG.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 764a1f290..fe07777de 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,10 @@ * Sheet export * most exports broken by Chrome 92, mostly fixed * we discovered that CSV export was not working in any major browser, though it's unclear why. We've disabled CSV export in the meantime -* some new browser-specific checkup tests to make it easier to detect future regressions in the APIs needed for sheet export + * updated translation to stop referring to Microsoft since we support OpenDocument formats + * some new browser-specific checkup tests to make it easier to detect future regressions in the APIs +* drive bug fixes + * guard against a few possible type errors # 4.9.0