mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-09 18:30:08 +00:00
file dialog: Return an error if no file is selected
This was brought as a problem for bindings in #6139. Fixes: #6139
This commit is contained in:
parent
833d307695
commit
22ceb018fb
@ -891,6 +891,10 @@ finish_file_op (GtkFileDialog *self,
|
||||
|
||||
if (g_list_model_get_n_items (files) > 0)
|
||||
file = g_list_model_get_item (files, 0);
|
||||
else
|
||||
g_set_error_literal (error,
|
||||
GTK_DIALOG_ERROR, GTK_DIALOG_ERROR_FAILED,
|
||||
"No file selected");
|
||||
|
||||
g_object_unref (files);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user