From 9b520dfb782c65ff0ab95712eaee4e7487e9729b Mon Sep 17 00:00:00 2001 From: Wim Date: Fri, 19 Apr 2019 23:08:41 +0200 Subject: Fix panic on nil message.Post (mattermost). Fixes #804 --- bridge/mattermost/helpers.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'bridge') diff --git a/bridge/mattermost/helpers.go b/bridge/mattermost/helpers.go index c6117624..121cd4db 100644 --- a/bridge/mattermost/helpers.go +++ b/bridge/mattermost/helpers.go @@ -186,6 +186,12 @@ func (b *Bmattermost) skipMessage(message *matterclient.Message) bool { return true } + // Ignore non-post messages + if message.Post == nil { + b.Log.Debugf("ignoring nil message.Post: %#v", message) + return true + } + // Ignore messages sent from matterbridge if message.Post.Props != nil { if _, ok := message.Post.Props["matterbridge_"+b.uuid].(bool); ok { -- cgit v1.2.3