diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-08-29 19:47:55 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-08-29 19:47:55 +0300 |
commit | f98174e48a2334a97c3827c6b471534bf8c49718 (patch) | |
tree | faca9f5b8f43c3f2dc65014bf5c1e7ca33b4a773 | |
parent | eec0212cbd8b984de17de07d4bae1be2c1720f41 (diff) |
Fixed crash when context menu is missing
-rw-r--r-- | src/ui/util.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ui/util.c b/src/ui/util.c index 71146682..11f41f6a 100644 --- a/src/ui/util.c +++ b/src/ui/util.c | |||
@@ -264,7 +264,7 @@ void closeMenu_Widget(iWidget *d) { | |||
264 | } | 264 | } |
265 | 265 | ||
266 | int checkContextMenu_Widget(iWidget *menu, const SDL_Event *ev) { | 266 | int checkContextMenu_Widget(iWidget *menu, const SDL_Event *ev) { |
267 | if (ev->type == SDL_MOUSEBUTTONDOWN && ev->button.button == SDL_BUTTON_RIGHT) { | 267 | if (menu && ev->type == SDL_MOUSEBUTTONDOWN && ev->button.button == SDL_BUTTON_RIGHT) { |
268 | if (isVisible_Widget(menu)) { | 268 | if (isVisible_Widget(menu)) { |
269 | closeMenu_Widget(menu); | 269 | closeMenu_Widget(menu); |
270 | return 0x1; | 270 | return 0x1; |