guard against type error when pinning channels of shared folders

This commit is contained in:
ansuz 2022-05-30 15:36:13 +05:30
parent feefd9bff0
commit 0d50a698ac
1 changed files with 6 additions and 2 deletions

View File

@ -1263,8 +1263,12 @@ define([
}
if (type === "pin") {
var sfChannels = Object.keys(Env.folders).map(function (fId) {
return Env.user.proxy[UserObject.SHARED_FOLDERS][fId].channel;
});
try {
return Env.user.proxy[UserObject.SHARED_FOLDERS][fId].channel;
} catch (err) {
console.error(err);
}
}).filter(Boolean);
Array.prototype.push.apply(result, sfChannels);
}