guard against type errors when users' extensions mangle URLs

pull/1/head
ansuz 4 years ago
parent 657b9e347b
commit b491408a0c

@ -203,6 +203,7 @@ define([
};
var showCategories = function (cat) {
hideCategories();
if (!Array.isArray(cat)) { return void console.error("invalid category"); }
cat.forEach(function (c) {
APP.$rightside.find('.'+c).show();
});
@ -214,6 +215,7 @@ define([
var metadataMgr = common.getMetadataMgr();
var privateData = metadataMgr.getPrivateData();
var active = privateData.category || 'tickets';
if (!categories[active]) { active = 'tickets'; }
common.setHash(active);
Object.keys(categories).forEach(function (key) {
var $category = $('<div>', {

Loading…
Cancel
Save