Skip to content

A platform for community discussion. Free, open, simple.

DEV: Add early returns to category color validation (#38583)

Isaac Janzene0dec4197eb3
diff --git a/frontend/discourse/admin/components/edit-category-general.gjs b/frontend/discourse/admin/components/edit-category-general.gjs
index c7196de4424..da04ad0220c 100644
--- a/frontend/discourse/admin/components/edit-category-general.gjs
+++ b/frontend/discourse/admin/components/edit-category-general.gjs
@@ -172,6 +172,7 @@ export default class EditCategoryGeneral extends Component {
title,
message: i18n("category.color_validations.cant_be_empty"),
});
+ return;
}
if (color.length !== 3 && color.length !== 6) {
@@ -179,6 +180,7 @@ export default class EditCategoryGeneral extends Component {
title,
message: i18n("category.color_validations.incorrect_length"),
});
+ return;
}
if (!/^[0-9A-Fa-f]+$/.test(color)) {