From 156b8e7721ae76f484b82765881a1216ae5f8805 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Sun, 30 Apr 2023 21:34:15 -0400 Subject: [PATCH] fix: add check for no tids --- public/src/client/category/tools.js | 3 +++ 1 file changed, 3 insertions(+) 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);