Fix: Message may be nil with new events

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2021-09-02 17:59:57 +02:00
parent 0984aeb60b
commit 57211b6184
Signed by: luzifer
GPG key ID: 0066F03ED215AD7D

View file

@ -19,6 +19,10 @@ type BadgeCollection map[string]*int
func ParseBadgeLevels(m *irc.Message) BadgeCollection { func ParseBadgeLevels(m *irc.Message) BadgeCollection {
out := BadgeCollection{} out := BadgeCollection{}
if m == nil {
return out
}
badgeString, ok := m.GetTag("badges") badgeString, ok := m.GetTag("badges")
if !ok || len(badgeString) == 0 { if !ok || len(badgeString) == 0 {
return out return out