summaryrefslogtreecommitdiffstats
path: root/bridge/discord/discord.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2017-06-15 22:29:01 +0200
committerWim <wim@42.be>2017-06-15 22:29:01 +0200
commit4b839b9958bc25c53cac71de5522d9decfa1d9b2 (patch)
tree98492a1abc287c0676c2c90dbb59adb0b3c5bafc /bridge/discord/discord.go
parent3f79da84d534832470cda4e1c4e82f41edb90722 (diff)
downloadmatterbridge-msglm-4b839b9958bc25c53cac71de5522d9decfa1d9b2.tar.gz
matterbridge-msglm-4b839b9958bc25c53cac71de5522d9decfa1d9b2.tar.bz2
matterbridge-msglm-4b839b9958bc25c53cac71de5522d9decfa1d9b2.zip
Avoid nil in usermembermap (discord). See #198
Diffstat (limited to 'bridge/discord/discord.go')
-rw-r--r--bridge/discord/discord.go3
1 files changed, 2 insertions, 1 deletions
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