diff --git a/Telegram/SourceFiles/boxes/peers/edit_participant_box.cpp b/Telegram/SourceFiles/boxes/peers/edit_participant_box.cpp index 6e205cb84..d867c0607 100644 --- a/Telegram/SourceFiles/boxes/peers/edit_participant_box.cpp +++ b/Telegram/SourceFiles/boxes/peers/edit_participant_box.cpp @@ -384,8 +384,11 @@ void EditAdminBox::prepare() { if (!_saveCallback) { return; } else if (_addAsAdmin && !_addAsAdmin->checked()) { + const auto weak = Ui::MakeWeak(this); AddBotToGroup(user(), peer(), _addingBot->token); - getDelegate()->hideLayer(); + if (const auto strong = weak.data()) { + strong->closeBox(); + } return; } else if (_addingBot && !_addingBot->existing) { const auto phrase = peer()->isBroadcast()