Fix UB in closing chat across all windows.

This commit is contained in:
John Preston 2022-09-23 15:53:58 +04:00
parent e01910ac68
commit aa674a0ea5
1 changed files with 1 additions and 3 deletions

View File

@ -1205,11 +1205,9 @@ void Application::closeWindow(not_null<Window::Controller*> window) {
void Application::closeChatFromWindows(not_null<PeerData*> peer) {
for (const auto &[history, window] : _secondaryWindows) {
if (!window) {
continue;
}
if (history->peer == peer) {
closeWindow(window.get());
break;
} else if (const auto session = window->sessionController()) {
if (session->activeChatCurrent().peer() == peer) {
session->showPeerHistory(