Don't set selection if there are no pages
This commit is contained in:
parent
7284f5958b
commit
da25fbfb27
1 changed files with 3 additions and 1 deletions
4
main.c
4
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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue