Fix showPeer crash when no chat is active

Task: 2026/08/13/fix-showpeer-crash-with-no-active-chat
This commit is contained in:
John Preston
2026-08-13 14:43:48 +04:00
parent 682972abb1
commit 86fc977ae8

View File

@@ -2816,7 +2816,8 @@ void SessionController::showPeer(not_null<PeerData*> peer, MsgId msgId) {
const auto clickedChannel = peer->asChannel();
if (!clickedChannel->isPublic()
&& !clickedChannel->amIn()
&& (!currentPeer->isChannel()
&& (!currentPeer
|| !currentPeer->isChannel()
|| currentPeer->asChannel()->discussionLink()
!= clickedChannel)) {
MainWindowShow(this).showToast(peer->isMegagroup()