Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crash on empty command in mattermost integration #326

Merged
merged 3 commits into from
Aug 19, 2020
Merged

Fix crash on empty command in mattermost integration #326

merged 3 commits into from
Aug 19, 2020

Conversation

gohumble
Copy link
Contributor

@gohumble gohumble commented Aug 19, 2020

ISSUE TYPE
  • Bug fix Pull Request
SUMMARY

This should fix panic on empty command.
Bot will send the default message for the executor Platform (in my case its mattermost)

What did you do?

Sent empty command to botkube via mattermost (type @botkube)

What did you expect to see?

Command not supported. Please run /botkubehelp to see supported commands.

or at least nothing

What did you see?

panic: runtime error: index out of range [0] with length 0 goroutine 28 [running]: github.com/infracloudio/botkube/pkg/execute.(*DefaultExecutor).Execute(0xc000a11020, 0x0, 0x0) go/src/github.com/gohumble/botkube/pkg/execute/executor.go:191 +0xe13 github.com/infracloudio/botkube/pkg/bot.(*mattermostMessage).handleMessage(0xc000b75de8, 0xc0003d1940, 0x1a, 0xc00046b7c0, 0x5, 0xc00046b7cc, 0x4, 0xc00046b120, 0xd, 0x1, ...) go/src/github.com/gohumble/botkube/pkg/bot/mattermost.go:154 +0x54e github.com/infracloudio/botkube/pkg/bot.MMBot.listen(0xc0003d1940, 0x1a, 0xc00046b7c0, 0x5, 0xc00046b7cc, 0x4, 0xc00046b120, 0xd, 0x1, 0xc0003d1880, ...) go/src/github.com/gohumble/botkube/pkg/bot/mattermost.go:253 +0x4d1 github.com/infracloudio/botkube/pkg/bot.(*MMBot).Start.func1(0xc00058f4d0) go/src/github.com/gohumble/botkube/pkg/bot/mattermost.go:125 +0x2c7 created by github.com/infracloudio/botkube/pkg/bot.(*MMBot).Start src/github.com/gohumble/botkube/pkg/bot/mattermost.go:113 +0x712 Exiting.

@PrasadG193
Copy link
Collaborator

Thanks @gohumble for fixing this 🙏

@PrasadG193 PrasadG193 changed the title Fix crash Fix crash on empty command in mattermost integration Aug 19, 2020
@mergify mergify bot merged commit e94e914 into kubeshop:develop Aug 19, 2020
@gohumble gohumble deleted the fix-crash branch September 30, 2021 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants