mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-02 05:40:43 +01:00
fix: throw error if topic does not exist
This commit is contained in:
@@ -64,7 +64,7 @@ module.exports = function (Topics) {
|
||||
topicTools.purge = async function (tid, uid) {
|
||||
const topicData = await Topics.getTopicData(tid);
|
||||
if (!topicData) {
|
||||
return;
|
||||
throw new Error('[[error:no-topic]]');
|
||||
}
|
||||
const canPurge = await privileges.topics.canPurge(tid, uid);
|
||||
if (!canPurge) {
|
||||
|
||||
Reference in New Issue
Block a user