summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWim <wim@42.be>2019-04-19 23:08:41 +0200
committerWim <wim@42.be>2019-04-23 23:27:56 +0200
commit1e6a2bc8f7637234afe23e472383d36e54551e7e (patch)
tree754c4fa1e03087515a70670f0c12c73b02ca32d4
parent82fe80e52f310314b718e413ea8af9a9f7531d0b (diff)
downloadmatterbridge-msglm-1e6a2bc8f7637234afe23e472383d36e54551e7e.tar.gz
matterbridge-msglm-1e6a2bc8f7637234afe23e472383d36e54551e7e.tar.bz2
matterbridge-msglm-1e6a2bc8f7637234afe23e472383d36e54551e7e.zip
Fix panic on nil message.Post (mattermost). Fixes #804
-rw-r--r--bridge/mattermost/helpers.go6
1 files changed, 6 insertions, 0 deletions
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 {