Fix crash in calls box.

This commit is contained in:
John Preston 2020-10-01 17:52:02 +03:00
parent c4dfc634d0
commit 454fe8cdf7
1 changed files with 2 additions and 1 deletions

View File

@ -274,7 +274,8 @@ void BoxController::prepare() {
session().changes().messageUpdates(
Data::MessageUpdate::Flag::NewAdded
) | rpl::filter([=](const Data::MessageUpdate &update) {
return (update.item->media()->call() != nullptr);
const auto media = update.item->media();
return (media != nullptr) && (media->call() != nullptr);
}) | rpl::start_with_next([=](const Data::MessageUpdate &update) {
insertRow(update.item, InsertWay::Prepend);
}, lifetime());