Fix error when trying to edit a category with empty slug

This commit is contained in:
Neil Lalonde 2013-06-11 15:43:07 -04:00
parent 82b5f57e40
commit a53f958c78

View file

@ -41,7 +41,8 @@ Discourse.ApplicationRoute = Em.Route.extend({
Discourse.Route.showModal(router, 'editCategory', category);
router.controllerFor('editCategory').set('selectedTab', 'general');
} else {
Discourse.Category.findBySlugOrId(category.get('slug')).then(function (c) {
Discourse.Category.findBySlugOrId(category.get('slug') || category.get('id')).then(function (c) {
console.log('ok show it now please');
Discourse.Site.instance().updateCategory(c);
Discourse.Route.showModal(router, 'editCategory', c);
router.controllerFor('editCategory').set('selectedTab', 'general');