diff options
author | Wim <wim@42.be> | 2019-04-19 23:08:41 +0200 |
---|---|---|
committer | Wim <wim@42.be> | 2019-04-19 23:08:41 +0200 |
commit | 9b520dfb782c65ff0ab95712eaee4e7487e9729b (patch) | |
tree | 2093defa2864bbe29ad242778a72c35f7ccdaf36 | |
parent | 8ad2be10b20b1c9a42397f86483f4b7663581e43 (diff) | |
download | matterbridge-msglm-9b520dfb782c65ff0ab95712eaee4e7487e9729b.tar.gz matterbridge-msglm-9b520dfb782c65ff0ab95712eaee4e7487e9729b.tar.bz2 matterbridge-msglm-9b520dfb782c65ff0ab95712eaee4e7487e9729b.zip |
Fix panic on nil message.Post (mattermost). Fixes #804
-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 { |