mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-15 13:47:05 +02:00
Guarded personal channel info from possible crash on deleting message.
This commit is contained in:
parent
de1f222bac
commit
1709fcd0df
1 changed files with 13 additions and 1 deletions
|
@ -1365,8 +1365,20 @@ object_ptr<Ui::RpWidget> DetailsFiller::setupPersonalChannel(
|
|||
const auto previewView = lifetime.make_state<MessageView>();
|
||||
preview->resize(0, st::infoLabeled.style.font->height);
|
||||
preview->paintRequest(
|
||||
) | rpl::start_with_next([=](const QRect &rect) {
|
||||
) | rpl::start_with_next([=, fullId = item->fullId()](
|
||||
const QRect &rect) {
|
||||
auto p = Painter(preview);
|
||||
const auto item = user->session().data().message(fullId);
|
||||
if (!item) {
|
||||
p.setPen(st::infoPersonalChannelDateLabel.textFg);
|
||||
p.setBrush(Qt::NoBrush);
|
||||
p.setFont(st::infoPersonalChannelDateLabel.style.font);
|
||||
p.drawText(
|
||||
preview->rect(),
|
||||
tr::lng_deleted_message(tr::now),
|
||||
style::al_left);
|
||||
return;
|
||||
}
|
||||
if (previewView->prepared(item, nullptr)) {
|
||||
previewView->paint(p, preview->rect(), {
|
||||
.st = &st::defaultDialogRow,
|
||||
|
|
Loading…
Add table
Reference in a new issue