GtkListBoxRow: add g_return_if_fail to grab_focus, don't crash

Although gtk_list_box_row_grab_focus() is not a public function
it can be easily called by gtk_widget_grab_focus() with a row argument
which has been removed from the list box and has box == NULL.

https://bugzilla.gnome.org/show_bug.cgi?id=744879
This commit is contained in:
Rafal Luzynski 2015-02-26 02:15:18 +01:00 committed by Matthias Clasen
parent 45210d5835
commit 3ce3593ebf

View File

@ -3487,6 +3487,8 @@ gtk_list_box_row_grab_focus (GtkWidget *widget)
GtkListBoxRow *row = GTK_LIST_BOX_ROW (widget);
GtkListBox *box = gtk_list_box_row_get_box (row);
g_return_if_fail (box != NULL);
if (BOX_PRIV (box)->cursor_row != row)
gtk_list_box_update_cursor (box, row, FALSE);