From fe97939abf0dc77ec4d0e66bf746bbc2a2a273bd Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 17 Aug 2020 10:43:51 +0400 Subject: [PATCH] Fix possible crash in call error handling. --- Telegram/SourceFiles/calls/calls_call.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/calls/calls_call.cpp b/Telegram/SourceFiles/calls/calls_call.cpp index ec89859fc7..c2d2a96045 100644 --- a/Telegram/SourceFiles/calls/calls_call.cpp +++ b/Telegram/SourceFiles/calls/calls_call.cpp @@ -409,7 +409,9 @@ void Call::redial() { } QString Call::getDebugLog() const { - return QString::fromStdString(_instance->getDebugInfo()); + return _instance + ? QString::fromStdString(_instance->getDebugInfo()) + : QString(); } void Call::startWaitingTrack() { @@ -833,7 +835,9 @@ void Call::handleControllerStateChange(tgcalls::State state) { } break; case tgcalls::State::Failed: { - auto error = QString::fromStdString(_instance->getLastError()); + auto error = _instance + ? QString::fromStdString(_instance->getLastError()) + : QString(); LOG(("Call Info: State changed to Failed, error: %1.").arg(error)); handleControllerError(error); } break;