From 4b839b9958bc25c53cac71de5522d9decfa1d9b2 Mon Sep 17 00:00:00 2001 From: Wim Date: Thu, 15 Jun 2017 22:29:01 +0200 Subject: Avoid nil in usermembermap (discord). See #198 --- bridge/discord/discord.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bridge/discord/discord.go b/bridge/discord/discord.go index 12d2e918..66e27256 100644 --- a/bridge/discord/discord.go +++ b/bridge/discord/discord.go @@ -169,10 +169,11 @@ func (b *bdiscord) getNick(user *discordgo.User) string { } } // if we didn't find nick, search for it - b.userMemberMap[user.ID], err = b.c.GuildMember(b.guildID, user.ID) + member, err := b.c.GuildMember(b.guildID, user.ID) if err != nil { return user.Username } + b.userMemberMap[user.ID] = member // only return if nick is set if b.userMemberMap[user.ID].Nick != "" { return b.userMemberMap[user.ID].Nick -- cgit v1.2.3