From 19cc7a73652158f8e3ac34c5ca84c634a50c91ad Mon Sep 17 00:00:00 2001 From: Faizaan Gagan Date: Mon, 22 Feb 2021 14:41:18 +0530 Subject: [PATCH] FIX: prevent error if no categories are passed (#72) --- .../wizard/components/similar-topics-validator.js.es6 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/assets/javascripts/wizard/components/similar-topics-validator.js.es6 b/assets/javascripts/wizard/components/similar-topics-validator.js.es6 index 1666f8fe..ada70181 100644 --- a/assets/javascripts/wizard/components/similar-topics-validator.js.es6 +++ b/assets/javascripts/wizard/components/similar-topics-validator.js.es6 @@ -30,7 +30,9 @@ export default WizardFieldValidator.extend({ @discourseComputed('validation.categories') validationCategories(categoryIds) { - return categoryIds.map(id => this.site.categoriesById[id]); + if (categoryIds) return categoryIds.map(id => this.site.categoriesById[id]); + + return A(); }, @discourseComputed('validationCategories')