From 298d69e9144c4480aeeae609f400cce5c23cda36 Mon Sep 17 00:00:00 2001 From: ansuz Date: Tue, 3 Aug 2021 12:23:10 +0530 Subject: [PATCH] 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; }