Skip to content

Node.js based forum software built for the modern web

fix: add check for no tids

Barış Soner Uşaklı156b8e7721ae
diff --git a/public/src/client/category/tools.js b/public/src/client/category/tools.js
index 4c214d5067..b941e398bc 100644
--- a/public/src/client/category/tools.js
+++ b/public/src/client/category/tools.js
@@ -119,6 +119,9 @@ define('forum/category/tools', [
components.get('topic/tag').on('click', async function () {
const tids = topicSelect.getSelectedTids();
+ if (!tids.length) {
+ return alerts.error('[[error:no-topics-selected]]');
+ }
const topics = await Promise.all(tids.map(tid => api.get(`/topics/${tid}`)));
require(['forum/topic/tag'], function (tag) {
tag.init(topics, ajaxify.data.tagWhitelist, onCommandComplete);