Skip to content

Commit 617f956

Browse files
authored
Merge pull request #459 from AttorneyOnline/fix/237
Fix crash to desktop if the "emotes" element has a height or width of zero
2 parents e6ced65 + ff7c45c commit 617f956

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/emotes.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ void Courtroom::refresh_emotes()
3939
QPoint p_point =
4040
ao_app->get_button_spacing("emote_button_size", "courtroom_design.ini");
4141

42+
if (ui_emotes->width() == 0 || ui_emotes->height() == 0) { // Workaround for a nasty crash
43+
ui_emotes->hide();
44+
return;
45+
}
46+
4247
const int button_width = p_point.x();
4348
int x_spacing = f_spacing.x();
4449
int x_mod_count = 0;

0 commit comments

Comments
 (0)