3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-16 14:11:50 +00:00

Fix logic error in case creation for manual kicks

This commit is contained in:
Dragory 2020-12-19 02:59:41 +02:00
parent 14bebfe405
commit a60cb92b74
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1

View file

@ -28,11 +28,10 @@ export const CreateKickCaseOnManualKickEvt = modActionsEvt(
); );
if (kickAuditLogEntry) { if (kickAuditLogEntry) {
const existingCaseForThisEntry = await pluginData.state.cases.findByAuditLogId(kickAuditLogEntry.id); let createdCase = await pluginData.state.cases.findByAuditLogId(kickAuditLogEntry.id);
let createdCase; if (createdCase) {
if (existingCaseForThisEntry) {
logger.warn( logger.warn(
`Tried to create duplicate case for audit log entry ${kickAuditLogEntry.id}, existing case id ${existingCaseForThisEntry.id}`, `Tried to create duplicate case for audit log entry ${kickAuditLogEntry.id}, existing case id ${createdCase.id}`,
); );
} else { } else {
const casesPlugin = pluginData.getPlugin(CasesPlugin); const casesPlugin = pluginData.getPlugin(CasesPlugin);