mirror of
https://github.com/vale981/tdesktop
synced 2025-03-06 02:01:40 -05:00
Fix possible crash in calendar box.
This commit is contained in:
parent
f0ed5640db
commit
b3f5973329
1 changed files with 7 additions and 5 deletions
|
@ -500,8 +500,8 @@ void Controller::showJumpToDate(Dialogs::Key chat, QDate requestedDate) {
|
|||
// return ParseDateTime(feed->chatListTimeId()).date();
|
||||
// }
|
||||
}
|
||||
return QDate::currentDate();
|
||||
};
|
||||
return QDate();
|
||||
}();
|
||||
const auto maxPeerDate = [](Dialogs::Key chat) {
|
||||
if (auto history = chat.history()) {
|
||||
if (const auto channel = history->peer->migrateTo()) {
|
||||
|
@ -545,9 +545,11 @@ void Controller::showJumpToDate(Dialogs::Key chat, QDate requestedDate) {
|
|||
}
|
||||
return startDate();
|
||||
};
|
||||
const auto highlighted = requestedDate.isNull()
|
||||
? currentPeerDate()
|
||||
: requestedDate;
|
||||
const auto highlighted = !requestedDate.isNull()
|
||||
? requestedDate
|
||||
: !currentPeerDate.isNull()
|
||||
? currentPeerDate
|
||||
: QDate::currentDate();
|
||||
const auto month = highlighted;
|
||||
auto callback = [=](const QDate &date) {
|
||||
session().api().jumpToDate(chat, date);
|
||||
|
|
Loading…
Add table
Reference in a new issue