mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-10 02:40:11 +00:00
filedialog: Don't assert too much
The GtkFileDialog code was asserting that we get exactly one file back. But the function is nullable anyway, so lets just return NULL if we don't have a file. Fixes: #5975
This commit is contained in:
parent
0b1bcf8bee
commit
79721d64ad
@ -887,11 +887,11 @@ finish_file_op (GtkFileDialog *self,
|
||||
files = g_task_propagate_pointer (task, error);
|
||||
if (files)
|
||||
{
|
||||
GFile *file;
|
||||
GFile *file = NULL;
|
||||
|
||||
g_assert (g_list_model_get_n_items (files) == 1);
|
||||
if (g_list_model_get_n_items (files) > 0)
|
||||
file = g_list_model_get_item (files, 0);
|
||||
|
||||
file = g_list_model_get_item (files, 0);
|
||||
g_object_unref (files);
|
||||
|
||||
return file;
|
||||
|
Loading…
Reference in New Issue
Block a user