The cancellation path already clears the GCancellable, if we let it
continue, it causes a later assertion, so just exit early in this case
and hope a new path has been set.
Fixes: #5792
{
GFile *file = G_FILE (source);
struct SetFileInfo *file_info = data;
+ GError *error = NULL;
- file_info->mount = g_file_find_enclosing_mount_finish (file, result, NULL);
+ file_info->mount = g_file_find_enclosing_mount_finish (file, result,
+ &error);
+
+ if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
+ {
+ gtk_path_bar_set_file_finish (file_info, FALSE);
+ g_clear_error (&error);
+ return;
+ }
+ g_clear_error (&error);
if (file_info->mount)
file_info->root_file = g_mount_get_root (file_info->mount);