aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.c4
1 files changed, 3 insertions, 1 deletions
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) {