From 5e1be8e5581779da5b84815b2e9c437d31113e7c Mon Sep 17 00:00:00 2001 From: Polynomdivision Date: Sat, 30 Oct 2021 15:50:37 +0000 Subject: [PATCH] Do not fail on no avatar data (xmpp) #1529 (#1627) * Detect errors when working with AvatarData * Remove not neccessary line Co-authored-by: Wim --- bridge/xmpp/xmpp.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bridge/xmpp/xmpp.go b/bridge/xmpp/xmpp.go index 687ca071..cf58a2fc 100644 --- a/bridge/xmpp/xmpp.go +++ b/bridge/xmpp/xmpp.go @@ -283,7 +283,13 @@ func (b *Bxmpp) handleXMPP() error { for { m, err := b.xc.Recv() if err != nil { - return err + // An error together with AvatarData is non-fatal + switch m.(type) { + case xmpp.AvatarData: + continue + default: + return err + } } switch v := m.(type) {