From c2a1cc2ae88e7b47389f2532a0cbfd570c8f81bd Mon Sep 17 00:00:00 2001 From: John Preston Date: Sun, 3 Sep 2017 22:30:04 +0300 Subject: [PATCH] Fix crash in contacts list box global search. Regression was introduced in f7359093b4. --- Telegram/SourceFiles/boxes/peer_list_controllers.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/boxes/peer_list_controllers.cpp b/Telegram/SourceFiles/boxes/peer_list_controllers.cpp index 27d154bf7..e827f21e2 100644 --- a/Telegram/SourceFiles/boxes/peer_list_controllers.cpp +++ b/Telegram/SourceFiles/boxes/peer_list_controllers.cpp @@ -329,7 +329,10 @@ void ContactsBoxController::checkForEmptyRows() { } std::unique_ptr ContactsBoxController::createSearchRow(not_null peer) { - return createRow(peer->asUser()); + if (auto user = peer->asUser()) { + return createRow(user); + } + return nullptr; } void ContactsBoxController::rowClicked(not_null row) {