From c0043d56eaf3156fbcf37d96d5538cd38a3aeaba Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 5 Nov 2020 14:58:36 +0300 Subject: [PATCH] Fix crash in search row select in privacy edition. --- Telegram/SourceFiles/boxes/edit_privacy_box.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/boxes/edit_privacy_box.cpp b/Telegram/SourceFiles/boxes/edit_privacy_box.cpp index 0c23ddb25b..3be617c737 100644 --- a/Telegram/SourceFiles/boxes/edit_privacy_box.cpp +++ b/Telegram/SourceFiles/boxes/edit_privacy_box.cpp @@ -77,8 +77,12 @@ std::vector> PrivacyExceptionsBoxController::getResult() con } void PrivacyExceptionsBoxController::rowClicked(not_null row) { + const auto peer = row->peer(); + + // This call may delete row, if it was a search result row. delegate()->peerListSetRowChecked(row, !row->checked()); - if (const auto channel = row->peer()->asChannel()) { + + if (const auto channel = peer->asChannel()) { if (!channel->membersCountKnown()) { channel->updateFull(); }