Merge branch 'fix-file-dialog-assert' into 'main'

filedialog: Don't assert too much

Closes #5975

See merge request GNOME/gtk!6207
This commit is contained in:
Matthias Clasen 2023-07-24 21:52:57 +00:00
commit 6653f2b4c3

View File

@ -887,11 +887,11 @@ finish_file_op (GtkFileDialog *self,
files = g_task_propagate_pointer (task, error);
if (files)
{
GFile *file;
g_assert (g_list_model_get_n_items (files) == 1);
GFile *file = NULL;
if (g_list_model_get_n_items (files) > 0)
file = g_list_model_get_item (files, 0);
g_object_unref (files);
return file;