From b1fc5b9a1a269fd3961643fd17e5d1d4718780d0 Mon Sep 17 00:00:00 2001 From: bivashy Date: Fri, 4 Aug 2023 05:40:10 +0600 Subject: [PATCH] Ignore AccountLinkEvent if roleModificationSettings is empty in DiscordLinkRoleModifierListener --- .../auth/discord/listener/DiscordLinkRoleModifierListener.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/src/main/java/me/mastercapexd/auth/discord/listener/DiscordLinkRoleModifierListener.java b/core/src/main/java/me/mastercapexd/auth/discord/listener/DiscordLinkRoleModifierListener.java index 5d912667..99332864 100644 --- a/core/src/main/java/me/mastercapexd/auth/discord/listener/DiscordLinkRoleModifierListener.java +++ b/core/src/main/java/me/mastercapexd/auth/discord/listener/DiscordLinkRoleModifierListener.java @@ -32,6 +32,8 @@ public void onDiscordLink(AccountLinkEvent e) { LinkType linkType = e.getLinkType(); if (linkType != DiscordLinkType.getInstance()) return; + if (roleModificationSettings.isEmpty()) + return; Optional playerOptional = account.getPlayer(); Guild guild = discordHook.getJDA().getGuildById(guildId);