summaryrefslogtreecommitdiffstats
path: root/bridge/mattermost/helpers.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2019-04-19 23:08:41 +0200
committerWim <wim@42.be>2019-04-19 23:08:41 +0200
commit9b520dfb782c65ff0ab95712eaee4e7487e9729b (patch)
tree2093defa2864bbe29ad242778a72c35f7ccdaf36 /bridge/mattermost/helpers.go
parent8ad2be10b20b1c9a42397f86483f4b7663581e43 (diff)
downloadmatterbridge-msglm-9b520dfb782c65ff0ab95712eaee4e7487e9729b.tar.gz
matterbridge-msglm-9b520dfb782c65ff0ab95712eaee4e7487e9729b.tar.bz2
matterbridge-msglm-9b520dfb782c65ff0ab95712eaee4e7487e9729b.zip
Fix panic on nil message.Post (mattermost). Fixes #804
Diffstat (limited to 'bridge/mattermost/helpers.go')
-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 {