fix: throw error if topic does not exist

v1.18.x
Barış Soner Uşaklı 5 years ago
parent e93578b81d
commit 59cf0e80d2

@ -64,7 +64,7 @@ module.exports = function (Topics) {
topicTools.purge = async function (tid, uid) { topicTools.purge = async function (tid, uid) {
const topicData = await Topics.getTopicData(tid); const topicData = await Topics.getTopicData(tid);
if (!topicData) { if (!topicData) {
return; throw new Error('[[error:no-topic]]');
} }
const canPurge = await privileges.topics.canPurge(tid, uid); const canPurge = await privileges.topics.canPurge(tid, uid);
if (!canPurge) { if (!canPurge) {

Loading…
Cancel
Save