diff options
author | Wim <wim@42.be> | 2019-04-19 23:08:41 +0200 |
---|---|---|
committer | Wim <wim@42.be> | 2019-04-23 23:27:56 +0200 |
commit | 1e6a2bc8f7637234afe23e472383d36e54551e7e (patch) | |
tree | 754c4fa1e03087515a70670f0c12c73b02ca32d4 /bridge/mattermost | |
parent | 82fe80e52f310314b718e413ea8af9a9f7531d0b (diff) | |
download | matterbridge-msglm-1e6a2bc8f7637234afe23e472383d36e54551e7e.tar.gz matterbridge-msglm-1e6a2bc8f7637234afe23e472383d36e54551e7e.tar.bz2 matterbridge-msglm-1e6a2bc8f7637234afe23e472383d36e54551e7e.zip |
Fix panic on nil message.Post (mattermost). Fixes #804
Diffstat (limited to 'bridge/mattermost')
-rw-r--r-- | bridge/mattermost/helpers.go | 6 |
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 { |