diff options
author | Alexander Schwinn <alexxcons@xfce.org> | 2021-12-23 11:51:45 +0100 |
---|---|---|
committer | Alexander Schwinn <alexxcons@xfce.org> | 2021-12-23 11:52:44 +0100 |
commit | a16a097947cd4a81eb0c46f19bca32b6b030345d (patch) | |
tree | 44259c6c5f6eb2af5d5eff8e05c02b2549bbfb49 /thunar | |
parent | 0490a94b74597c84d298b926ee604f35b0d2c859 (diff) | |
download | thunar-a16a097947cd4a81eb0c46f19bca32b6b030345d.tar.gz |
Prevent rare thunarx-CRITICAL in thunar_file_set_metadata_setting_finish
Seldom can occur on closing thunar (reference to thunar-file not valid
any more)
Diffstat (limited to 'thunar')
-rw-r--r-- | thunar/thunar-file.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/thunar/thunar-file.c b/thunar/thunar-file.c index 4755565c..c73a9b08 100644 --- a/thunar/thunar-file.c +++ b/thunar/thunar-file.c @@ -4642,16 +4642,20 @@ thunar_file_set_metadata_setting_finish (GObject *source_object, GAsyncResult *result, gpointer user_data) { - ThunarFile *file = THUNAR_FILE (user_data); + ThunarFile *file = NULL; GError *error = NULL; + if (THUNAR_IS_FILE (user_data)) + file = THUNAR_FILE (user_data); + if (!g_file_set_attributes_finish (G_FILE (source_object), result, NULL, &error)) { g_warning ("Failed to set metadata: %s", error->message); g_error_free (error); } - - thunar_file_changed (file); + + if (file != NULL) + thunar_file_changed (file); } |