summaryrefslogtreecommitdiffstats
path: root/bridge/mattermost/mattermost.go
diff options
context:
space:
mode:
Diffstat (limited to 'bridge/mattermost/mattermost.go')
-rw-r--r--bridge/mattermost/mattermost.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/bridge/mattermost/mattermost.go b/bridge/mattermost/mattermost.go
index 4c7c05b5..f1d3db64 100644
--- a/bridge/mattermost/mattermost.go
+++ b/bridge/mattermost/mattermost.go
@@ -180,13 +180,17 @@ func (b *Bmattermost) Send(msg config.Message) (string, error) {
if err != nil {
b.Log.Errorf("getting post %s failed: %s", msg.ParentID, err)
}
- msg.ParentID = post.RootId
+ if post.RootId != "" {
+ msg.ParentID = post.RootId
+ }
} else {
post, res := b.mc.Client.GetPost(msg.ParentID, "")
if res.Error != nil {
b.Log.Errorf("getting post %s failed: %s", msg.ParentID, res.Error.DetailedError)
}
- msg.ParentID = post.RootId
+ if post.RootId != "" {
+ msg.ParentID = post.RootId
+ }
}
}