2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Fix crash on launch with passcode.

This commit is contained in:
John Preston
2022-06-15 14:49:06 +04:00
parent 014cd19e93
commit aa484ac015
3 changed files with 16 additions and 9 deletions

View File

@@ -797,13 +797,11 @@ void Application::handleAppDeactivated() {
if (_primaryWindow) {
_primaryWindow->updateIsActiveBlur();
}
if (_domain->started()) {
const auto session = _lastActiveWindow
? _lastActiveWindow->account().maybeSession()
: nullptr;
if (session) {
session->updates().updateOnline();
}
const auto session = _lastActiveWindow
? _lastActiveWindow->maybeSession()
: nullptr;
if (session) {
session->updates().updateOnline();
}
Ui::Tooltip::Hide();
}
@@ -1235,8 +1233,8 @@ void Application::windowActivated(not_null<Window::Controller*> window) {
const auto now = window;
_lastActiveWindow = window;
const auto wasSession = was ? was->account().maybeSession() : nullptr;
const auto nowSession = now->account().maybeSession();
const auto wasSession = was ? was->maybeSession() : nullptr;
const auto nowSession = now->maybeSession();
if (wasSession != nowSession) {
if (wasSession) {
wasSession->updates().updateOnline();