From b49a8e6dc11688a1480cc3764d339d5ea0c4b000 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Wed, 17 Jun 2020 17:00:20 +0300 Subject: [PATCH] Fixed crash on pinning dialog from context menu. Regression was introduced in 3a147305b7. --- Telegram/SourceFiles/window/window_peer_menu.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/window/window_peer_menu.cpp b/Telegram/SourceFiles/window/window_peer_menu.cpp index ec67310c7c..d33d5e05a8 100644 --- a/Telegram/SourceFiles/window/window_peer_menu.cpp +++ b/Telegram/SourceFiles/window/window_peer_menu.cpp @@ -306,6 +306,7 @@ void Filler::addHidePromotion() { } void Filler::addTogglePin() { + const auto controller = _controller; const auto filterId = _filterId; const auto peer = _peer; const auto history = peer->owner().history(peer); @@ -315,7 +316,7 @@ void Filler::addTogglePin() { : tr::lng_context_pin_to_top(tr::now); }; const auto pinToggle = [=] { - TogglePinnedDialog(_controller, history, filterId); + TogglePinnedDialog(controller, history, filterId); }; const auto pinAction = _addAction(pinText(), pinToggle);