# HG changeset patch # User Sadrul Habib Chowdhury # Date 1188996831 0 # Node ID 21e67147f9f0375d2fcb5deb64109ef6da2eac49 # Parent 450f4a3c4c0f0c38729fa2d1e882d13859f25528 Do not crash when pressing a key in an empty menu. Thanks to CmdrChalupa in #pidgin for the bug report. diff -r 450f4a3c4c0f -r 21e67147f9f0 finch/libgnt/gntmenu.c --- a/finch/libgnt/gntmenu.c Wed Sep 05 01:12:44 2007 +0000 +++ b/finch/libgnt/gntmenu.c Wed Sep 05 12:53:51 2007 +0000 @@ -221,8 +221,13 @@ { /* check for a trigger key */ GList *iter; + GList *find; GList *nth = g_list_find(menu->list, gnt_tree_get_selection_data(GNT_TREE(menu))); - GList *find = find_item_with_trigger(nth->next, NULL, trigger); + + if (nth == NULL) + return FALSE; + + find = find_item_with_trigger(nth->next, NULL, trigger); if (!find) find = find_item_with_trigger(menu->list, nth->next, trigger); if (!find)