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 + } } }