summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian P <5564491+s3lph@users.noreply.github.com>2020-12-03 22:25:33 +0100
committerGitHub <noreply@github.com>2020-12-03 22:25:33 +0100
commit44d182e2f93b5652a3e7595030a2f61f1453fdc5 (patch)
tree8999f79a3b58451518666ebcc7b932cdf87dec65
parentad95e356877babdf38953a521f54b303e108d490 (diff)
downloadmatterbridge-msglm-44d182e2f93b5652a3e7595030a2f61f1453fdc5.tar.gz
matterbridge-msglm-44d182e2f93b5652a3e7595030a2f61f1453fdc5.tar.bz2
matterbridge-msglm-44d182e2f93b5652a3e7595030a2f61f1453fdc5.zip
Add nil checks to text message handling (mumble) (#1321)
-rw-r--r--bridge/mumble/handlers.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/bridge/mumble/handlers.go b/bridge/mumble/handlers.go
index a6845955..40272633 100644
--- a/bridge/mumble/handlers.go
+++ b/bridge/mumble/handlers.go
@@ -19,6 +19,12 @@ func (b *Bmumble) handleTextMessage(event *gumble.TextMessageEvent) {
if event.TextMessage.Sender != nil {
sender = event.TextMessage.Sender.Name
}
+ // If the text message is received before receiving a ServerSync
+ // and UserState, Client.Self or Self.Channel are nil
+ if event.Client.Self == nil || event.Client.Self.Channel == nil {
+ b.Log.Warn("Connection bootstrap not finished, discarding text message")
+ return
+ }
// Convert Mumble HTML messages to markdown
parts, err := b.convertHTMLtoMarkdown(event.TextMessage.Message)
if err != nil {