Mercurial > pidgin.yaz
diff finch/libgnt/gntmenu.c @ 19651:21e67147f9f0
Do not crash when pressing a key in an empty menu. Thanks to CmdrChalupa in
#pidgin for the bug report.
author | Sadrul Habib Chowdhury <imadil@gmail.com> |
---|---|
date | Wed, 05 Sep 2007 12:53:51 +0000 |
parents | 6a911f06aa46 |
children | aa3920f45ff3 |
line wrap: on
line diff
--- 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)