Fix possible crash in calendar box.
This commit is contained in:
parent
f0ed5640db
commit
b3f5973329
|
@ -500,8 +500,8 @@ void Controller::showJumpToDate(Dialogs::Key chat, QDate requestedDate) {
|
||||||
// return ParseDateTime(feed->chatListTimeId()).date();
|
// return ParseDateTime(feed->chatListTimeId()).date();
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
return QDate::currentDate();
|
return QDate();
|
||||||
};
|
}();
|
||||||
const auto maxPeerDate = [](Dialogs::Key chat) {
|
const auto maxPeerDate = [](Dialogs::Key chat) {
|
||||||
if (auto history = chat.history()) {
|
if (auto history = chat.history()) {
|
||||||
if (const auto channel = history->peer->migrateTo()) {
|
if (const auto channel = history->peer->migrateTo()) {
|
||||||
|
@ -545,9 +545,11 @@ void Controller::showJumpToDate(Dialogs::Key chat, QDate requestedDate) {
|
||||||
}
|
}
|
||||||
return startDate();
|
return startDate();
|
||||||
};
|
};
|
||||||
const auto highlighted = requestedDate.isNull()
|
const auto highlighted = !requestedDate.isNull()
|
||||||
? currentPeerDate()
|
? requestedDate
|
||||||
: requestedDate;
|
: !currentPeerDate.isNull()
|
||||||
|
? currentPeerDate
|
||||||
|
: QDate::currentDate();
|
||||||
const auto month = highlighted;
|
const auto month = highlighted;
|
||||||
auto callback = [=](const QDate &date) {
|
auto callback = [=](const QDate &date) {
|
||||||
session().api().jumpToDate(chat, date);
|
session().api().jumpToDate(chat, date);
|
||||||
|
|
Loading…
Reference in New Issue