Fix possible crash when update is ready.

Regression was introduced in 9a0be43ef5.
This commit is contained in:
John Preston 2022-01-19 18:59:43 +03:00
parent d6e03c3e48
commit a5425042cf
1 changed files with 9 additions and 3 deletions

View File

@ -595,7 +595,9 @@ void Widget::checkUpdateStatus() {
using Checker = Core::UpdateChecker;
if (Checker().state() == Checker::State::Ready) {
if (_updateTelegram) return;
if (_updateTelegram) {
return;
}
_updateTelegram.create(
this,
tr::lng_update_telegram(tr::now),
@ -607,9 +609,13 @@ void Widget::checkUpdateStatus() {
Core::checkReadyUpdate();
App::restart();
});
_connecting->raise();
if (_connecting) {
_connecting->raise();
}
} else {
if (!_updateTelegram) return;
if (!_updateTelegram) {
return;
}
_updateTelegram.destroy();
}
updateControlsGeometry();