Ticket #3652: listbox-fix-assertion-emptylist-asserts-rev0.diff
File listbox-fix-assertion-emptylist-asserts-rev0.diff, 1.2 KB (added by wwp, 9 years ago) |
---|
-
lib/widget/listbox.
old new 52 52 /*** file scope macro definitions ****************************************************************/ 53 53 54 54 /* Gives the position of the last item. */ 55 #define LISTBOX_LAST(l) ( (l) && ((l)->list) &&g_queue_is_empty ((l)->list) ? 0 : (int) g_queue_get_length ((l)->list) - 1)55 #define LISTBOX_LAST(l) (l == NULL || l->list == NULL || g_queue_is_empty ((l)->list) ? 0 : (int) g_queue_get_length ((l)->list) - 1) 56 56 57 57 /*** file scope type declarations ****************************************************************/ 58 58 … … 229 229 static void 230 230 listbox_fwd (WListbox * l, gboolean wrap) 231 231 { 232 if (l->list != NULL) 233 { 232 234 if ((guint) l->pos + 1 < g_queue_get_length (l->list)) 233 235 listbox_select_entry (l, l->pos + 1); 234 236 else if (wrap) 235 237 listbox_select_first (l); 238 } 236 239 } 237 240 238 241 /* --------------------------------------------------------------------------------------------- */ … … 400 403 { 401 404 int action; 402 405 406 if (l->list == NULL) 407 return; 408 403 409 if (l->callback != NULL) 404 410 action = l->callback (l); 405 411 else