Fix possible crash in call error handling.

This commit is contained in:
John Preston 2020-08-17 10:43:51 +04:00
parent 8ce798db12
commit fe97939abf
1 changed files with 6 additions and 2 deletions

View File

@ -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;