diff options
| author | oldmud0 <oldmud0@users.noreply.github.com> | 2021-02-10 00:17:58 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-02-10 00:17:58 -0600 |
| commit | 617f956f2af896f691910abdec11da1960a87854 (patch) | |
| tree | 04b821de5f238ebc3dada67d2be1188474a8fd15 | |
| parent | e6ced659226d685199146719fc91b5b60890de98 (diff) | |
| parent | ff7c45cfc24deffaef4a33c3d44f6e655bbce8d0 (diff) | |
Merge pull request #459 from AttorneyOnline/fix/237
Fix crash to desktop if the "emotes" element has a height or width of zero
| -rw-r--r-- | src/emotes.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/emotes.cpp b/src/emotes.cpp index 8de55244..38250c93 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; |
