diff --git a/server/channel_state.go b/server/channel_state.go index 18fe65a0b..85f6d2afd 100644 --- a/server/channel_state.go +++ b/server/channel_state.go @@ -314,7 +314,7 @@ func (p *Plugin) cleanCallState(channelID string, state *channelState) error { if state.Call != nil { if _, err := p.updateCallPostEnded(state.Call.PostID, mapKeys(state.Call.Stats.Participants)); err != nil { - return err + p.LogError("failed to update call post", "err", err.Error()) } state.Call = nil } diff --git a/server/plugin.go b/server/plugin.go index 241dd90eb..7881157a3 100644 --- a/server/plugin.go +++ b/server/plugin.go @@ -333,6 +333,10 @@ func (p *Plugin) createCallStartedPost(state *channelState, userID, channelID, t } func (p *Plugin) updateCallPostEnded(postID string, participants []string) (float64, error) { + if postID == "" { + return 0, fmt.Errorf("postID should not be empty") + } + post, appErr := p.API.GetPost(postID) if appErr != nil { return 0, appErr