mirror of
https://github.com/discourse/discourse.git
synced 2024-11-30 20:54:00 -06:00
FIX: show 404 page for links to categories that don't exists or you don't have access to, instead of showing blank page with js errors
This commit is contained in:
parent
b4b992299d
commit
12a0260a8c
@ -99,6 +99,11 @@ function buildCategoryRoute(filter, params) {
|
||||
},
|
||||
|
||||
afterModel: function(model, transaction) {
|
||||
if (!model) {
|
||||
this.replaceWith('/404');
|
||||
return;
|
||||
}
|
||||
|
||||
var self = this,
|
||||
noSubcategories = params && !!params.no_subcategories,
|
||||
filterMode = "category/" + Discourse.Category.slugFor(model) + (noSubcategories ? "/none" : "") + "/l/" + filter,
|
||||
|
Loading…
Reference in New Issue
Block a user