Fix null pointer dereference error

This commit is contained in:
Alex 2020-04-05 14:32:49 +02:00
parent 88e435052c
commit 473336f0eb
1 changed files with 1 additions and 1 deletions

View File

@ -607,7 +607,7 @@ func (mm *Mattermost) handlePost(channel_name string, post *model.Post, only_mes
}
// Handle files
if post.FileIds != nil && len(post.FileIds) > 0 {
if post.Metadata != nil && post.Metadata.Files != nil {
msg_ev.Attachments = []SMediaObject{}
for _, file := range post.Metadata.Files {
media_object := &LazyBlobMediaObject{