From f9167689dcd4ab0231bacdcdf0173747fb6a738b Mon Sep 17 00:00:00 2001 From: adnano Date: Mon, 26 Feb 2024 16:31:41 -0500 Subject: Check if selection is not null before dereferencing --- main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.c b/main.c index c288e99..94de88f 100644 --- a/main.c +++ b/main.c @@ -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); } -- cgit v1.2.3