From 3583235542061237bed3b0393d3b8aac22ea3cac Mon Sep 17 00:00:00 2001 From: Robert Adam Date: Sat, 20 Jun 2020 11:39:29 +0200 Subject: [PATCH] FIX(text-chat): Fix crash on TextMessage from server 1a4d134a35b656113684b8070a74bfd2474304a1 introduced the ability to disable TTS for specific users. The change however didn't account for messages that are sent from the server. In these cases pSrc is nullptr but that commit introduced code that access it without checking for null. This lead to a SegFault as soon as a text message from the server is received. This commit fixes this by simply adding a null-check before accessing the variable. --- src/mumble/Messages.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mumble/Messages.cpp b/src/mumble/Messages.cpp index df134144f..70c6e3e87 100644 --- a/src/mumble/Messages.cpp +++ b/src/mumble/Messages.cpp @@ -912,7 +912,7 @@ void MainWindow::msgTextMessage(const MumbleProto::TextMessage &msg) { tr("Message from %1").arg(plainName), false, overrideTTS.isNull() ? QString() : overrideTTS, - pSrc->bLocalIgnoreTTS); + pSrc ? pSrc->bLocalIgnoreTTS : false); } /// This message is being received when the server informs the client about the access control list (ACL) for