From 3f041545bf613da92c900bc6f6bd60ea932f00f7 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 12 Aug 2019 16:55:44 +0100 Subject: [PATCH] Fix crash in local passcode reset. --- Telegram/SourceFiles/core/application.cpp | 4 ++++ Telegram/SourceFiles/main/main_account.cpp | 2 -- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/core/application.cpp b/Telegram/SourceFiles/core/application.cpp index f12b4fb00..c88dc5ab5 100644 --- a/Telegram/SourceFiles/core/application.cpp +++ b/Telegram/SourceFiles/core/application.cpp @@ -583,6 +583,10 @@ void Application::lockByPasscode() { void Application::unlockPasscode() { clearPasscodeLock(); + if (!activeAccount().mtp()) { + // We unlocked initial passcode, so we just start mtproto. + activeAccount().startMtp(); + } if (_window) { _window->clearPasscodeLock(); } diff --git a/Telegram/SourceFiles/main/main_account.cpp b/Telegram/SourceFiles/main/main_account.cpp index eac584216..67930a1c4 100644 --- a/Telegram/SourceFiles/main/main_account.cpp +++ b/Telegram/SourceFiles/main/main_account.cpp @@ -368,8 +368,6 @@ void Account::logOut() { })); } else { // We log out because we've forgotten passcode. - // So we just start mtproto from scratch. - startMtp(); loggedOut(); } }