From c57afe821e637fe08467848190a83553d913aaa6 Mon Sep 17 00:00:00 2001 From: Salanto <62221668+Salanto@users.noreply.github.com> Date: Fri, 24 Dec 2021 21:36:41 +0100 Subject: [PATCH] Sanity check before removing the ui element (#612) Co-authored-by: oldmud0 --- src/courtroom.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/courtroom.cpp b/src/courtroom.cpp index a9f2da6..f909526 100644 --- a/src/courtroom.cpp +++ b/src/courtroom.cpp @@ -4436,10 +4436,11 @@ void Courtroom::set_sfx_dropdown() void Courtroom::on_sfx_dropdown_changed(int p_index) { - Q_UNUSED(p_index); ui_ic_chat_message->setFocus(); - ui_sfx_remove->hide(); - custom_sfx = ""; + if (p_index == 0) { + ui_sfx_remove->hide(); + custom_sfx = ""; + } } void Courtroom::on_sfx_dropdown_custom(QString p_sfx)