diff options
author | adnano <me@adnano.co> | 2024-02-26 16:31:41 -0500 |
---|---|---|
committer | adnano <me@adnano.co> | 2024-02-26 16:31:41 -0500 |
commit | f9167689dcd4ab0231bacdcdf0173747fb6a738b (patch) | |
tree | 5e8a21ec348a4d475fae19e92b455b31195993dd | |
parent | c6025455ec7a5a2ce0367097d465c7188759886b (diff) | |
download | wmenu-f9167689dcd4ab0231bacdcdf0173747fb6a738b.tar.gz |
Check if selection is not null before dereferencing
-rw-r--r-- | main.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -714,14 +714,14 @@ static void keypress(struct menu *menu, enum wl_keyboard_key_state key_state, break; case XKB_KEY_Page_Up: case XKB_KEY_KP_Page_Up: - if (menu->sel->page->prev) { + if (menu->sel && menu->sel->page->prev) { menu->sel = menu->sel->page->prev->first; render_frame(menu); } break; case XKB_KEY_Page_Down: case XKB_KEY_KP_Page_Down: - if (menu->sel->page->next) { + if (menu->sel && menu->sel->page->next) { menu->sel = menu->sel->page->next->first; render_frame(menu); } |