From ff7c45cfc24deffaef4a33c3d44f6e655bbce8d0 Mon Sep 17 00:00:00 2001 From: in1tiate Date: Tue, 9 Feb 2021 23:46:59 -0600 Subject: [PATCH] add workaround for emotes crash --- src/emotes.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/emotes.cpp b/src/emotes.cpp index 8de5524..38250c9 100644 --- a/src/emotes.cpp +++ b/src/emotes.cpp @@ -39,6 +39,11 @@ void Courtroom::refresh_emotes() QPoint p_point = ao_app->get_button_spacing("emote_button_size", "courtroom_design.ini"); + if (ui_emotes->width() == 0 || ui_emotes->height() == 0) { // Workaround for a nasty crash + ui_emotes->hide(); + return; + } + const int button_width = p_point.x(); int x_spacing = f_spacing.x(); int x_mod_count = 0;