mirror of
https://github.com/cwinfo/matterbridge.git
synced 2024-11-25 09:51:36 +00:00
Add nil checks to text message handling (mumble) (#1321)
This commit is contained in:
parent
ad95e35687
commit
44d182e2f9
@ -19,6 +19,12 @@ func (b *Bmumble) handleTextMessage(event *gumble.TextMessageEvent) {
|
|||||||
if event.TextMessage.Sender != nil {
|
if event.TextMessage.Sender != nil {
|
||||||
sender = event.TextMessage.Sender.Name
|
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
|
// Convert Mumble HTML messages to markdown
|
||||||
parts, err := b.convertHTMLtoMarkdown(event.TextMessage.Message)
|
parts, err := b.convertHTMLtoMarkdown(event.TextMessage.Message)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user