From da25fbfb275e5f9ffa7fff3ff1cd1d6f16c652b1 Mon Sep 17 00:00:00 2001 From: adnano Date: Mon, 26 Feb 2024 15:05:37 -0500 Subject: Don't set selection if there are no pages --- main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'main.c') diff --git a/main.c b/main.c index fc9438b..9e67f7f 100644 --- a/main.c +++ b/main.c @@ -236,7 +236,9 @@ static void match_items(struct menu *menu) { } page_items(menu); - menu->sel = menu->pages->first; + if (menu->pages) { + menu->sel = menu->pages->first; + } } static void insert(struct menu *menu, const char *s, ssize_t n) { -- cgit v1.2.3