From 1e6a2bc8f7637234afe23e472383d36e54551e7e Mon Sep 17 00:00:00 2001 From: Wim Date: Fri, 19 Apr 2019 23:08:41 +0200 Subject: [PATCH] Fix panic on nil message.Post (mattermost). Fixes #804 --- bridge/mattermost/helpers.go | 6 ++++++ 1 file changed, 6 insertions(+) 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 {