guard against another possible type error

(in the user object)
This commit is contained in:
ansuz 2021-08-03 12:23:10 +05:30
parent 22357f882b
commit 298d69e914
1 changed files with 6 additions and 1 deletions

View File

@ -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;
}