Don't set selection if there are no pages - wmenu - 🔧 fork of wmenu
 (HTM) git clone git@git.drkhsh.at/wmenu.git
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit da25fbfb275e5f9ffa7fff3ff1cd1d6f16c652b1
 (DIR) parent 7284f5958bea340e25598562821b73db3c26ee63
 (HTM) Author: adnano <me@adnano.co>
       Date:   Mon, 26 Feb 2024 15:05:37 -0500
       
       Don't set selection if there are no pages
       
       Diffstat:
         M main.c                              |       4 +++-
       
       1 file changed, 3 insertions(+), 1 deletion(-)
       ---
 (DIR) diff --git 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) {