Skip to content

Commit

Permalink
fix mumblebee crashing on server message
Browse files Browse the repository at this point in the history
  • Loading branch information
Keridos authored and muesli committed Dec 13, 2021
1 parent dfc6fd3 commit d636b69
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion bees/mumblebee/mumblebee.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
*
* Authors:
* Martin Schlierf <[email protected]>
* Nicholas Kreimeyer <[email protected]>
*/

// Package mumblebee is a Bee that can connect to a Mumble/XMPP server.
Expand Down Expand Up @@ -133,6 +134,10 @@ func (mod *MumbleBee) Run(eventChan chan bees.Event) {

config.Attach(gumbleutil.Listener{
TextMessage: func(e *gumble.TextMessageEvent) {
senderName := "Server"
if e.Sender != nil {
senderName = e.Sender.Name
}
ev := bees.Event{
Bee: mod.Name(),
Name: "message",
Expand All @@ -145,7 +150,7 @@ func (mod *MumbleBee) Run(eventChan chan bees.Event) {
{
Name: "user",
Type: "string",
Value: e.Sender.Name,
Value: senderName,
},
{
Name: "text",
Expand Down

0 comments on commit d636b69

Please sign in to comment.