Fix a possible crash in messages list.

This commit is contained in:
John Preston 2023-07-26 09:48:44 +04:00
parent 2d31704bde
commit e71f614f4d
1 changed files with 1 additions and 1 deletions

View File

@ -933,7 +933,7 @@ Element *ListWidget::viewByPosition(Data::MessagePosition position) const {
const auto result = (index < 0) ? nullptr : _items[index].get();
return (position == Data::MinMessagePosition
|| position == Data::MaxMessagePosition
|| result->data()->position() == position)
|| (result && result->data()->position() == position))
? result
: nullptr;
}