Skip to content

Commit

Permalink
fix invalid memory address or nil pointer deference on mattermost (#184)
Browse files Browse the repository at this point in the history
event is nil in this case. adding nil check is needed

Signed-off-by: gangseok.lee <gangseok.lee@samsung.com>
  • Loading branch information
gangseok514 authored and PrasadG193 committed Oct 4, 2019
1 parent 2f43ab9 commit f1bc12c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/bot/mattermost.go
Expand Up @@ -101,7 +101,7 @@ func (b *MMBot) Start() {
go func() {
for {
event := <-webSocketClient.EventChannel
if event.Event != model.WEBSOCKET_EVENT_POSTED {
if event == nil || event.Event != model.WEBSOCKET_EVENT_POSTED {
continue
}
post := model.PostFromJson(strings.NewReader(event.Data["post"].(string)))
Expand Down

0 comments on commit f1bc12c

Please sign in to comment.