mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-12 20:00:09 +00:00
listitemmanager: Handle null roots in get_nearest_tile
Rubberbanding still fails with "No item" warnings, but it no longer crashes. Closes #5970
This commit is contained in:
parent
83db8e41a6
commit
657c018242
@ -575,9 +575,14 @@ gtk_list_item_manager_get_nearest_tile (GtkListItemManager *self,
|
||||
int x,
|
||||
int y)
|
||||
{
|
||||
GtkListTile *root;
|
||||
int distance = G_MAXINT;
|
||||
|
||||
return gtk_list_tile_get_tile_at (self, gtk_list_item_manager_get_root (self), x, y, &distance);
|
||||
root = gtk_list_item_manager_get_root (self);
|
||||
if (root == NULL)
|
||||
return NULL;
|
||||
|
||||
return gtk_list_tile_get_tile_at (self, root, x, y, &distance);
|
||||
}
|
||||
|
||||
guint
|
||||
|
Loading…
Reference in New Issue
Block a user