From e684bf7dacb932e58fef193c5f678dc27751c918 Mon Sep 17 00:00:00 2001 From: Dragory <2606411+Dragory@users.noreply.github.com> Date: Tue, 2 Jun 2020 01:36:42 +0300 Subject: [PATCH] Don't save empty nicknames to nickname history if there's no previous entry --- backend/src/plugins/NameHistory.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/backend/src/plugins/NameHistory.ts b/backend/src/plugins/NameHistory.ts index dbc2946d..ddc0ed6b 100644 --- a/backend/src/plugins/NameHistory.ts +++ b/backend/src/plugins/NameHistory.ts @@ -84,6 +84,7 @@ export class NameHistoryPlugin extends ZeppelinPlugin { if (!member) return; const latestEntry = await this.nicknameHistory.getLastEntry(member.id); if (!latestEntry || latestEntry.nickname !== member.nick) { + if (!latestEntry && member.nick == null) return; // No need to save "no nickname" if there's no previous data await this.nicknameHistory.addEntry(member.id, member.nick); } }