3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-21 08:45:03 +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 da16988c99
commit 28f37c3bc3

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);