Fix NPE when using avatars in discord module (Fixes #5748)

This commit is contained in:
JRoy 2024-06-29 14:38:36 -04:00 committed by Josh Roy
parent b392f03ad1
commit 9e57dd6aef

View File

@ -383,11 +383,10 @@ public class JDADiscordService implements DiscordService, IEssentialsModule {
final Webhook webhook = DiscordUtil.getOrCreateWebhook(channel, DiscordUtil.ADVANCED_RELAY_NAME).join();
if (webhook == null) {
final WrappedWebhookClient current = channelIdToWebhook.get(channel.getId());
final WrappedWebhookClient current = channelIdToWebhook.remove(channel.getId());
if (current != null) {
current.close();
}
channelIdToWebhook.remove(channel.getId()).close();
continue;
}
typeToChannelId.put(type, channel.getId());