From 701f7c6cf6a095cc305642907958a0778614ffda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Tyrychtr?= Date: Thu, 29 Jun 2023 14:32:35 +0200 Subject: [PATCH] users-panel, cc-awatar-chooser: Don't request a symlink target for a file info when it is not a symlink. That previously caused a debug message, but will cause a g_critical. Fixes #2547 --- panels/user-accounts/cc-avatar-chooser.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/panels/user-accounts/cc-avatar-chooser.c b/panels/user-accounts/cc-avatar-chooser.c index 182780601..9c98aee4f 100644 --- a/panels/user-accounts/cc-avatar-chooser.c +++ b/panels/user-accounts/cc-avatar-chooser.c @@ -277,13 +277,9 @@ get_system_facesdirs (void) static gboolean add_faces_from_dirs (GListStore *faces, GStrv facesdirs, gboolean add_all) { - GFile *file; - GFileType type; - const gchar *target; - guint i; gboolean added_faces = FALSE; - for (i = 0; facesdirs[i] != NULL; i++) { + for (guint i = 0; facesdirs[i] != NULL; i++) { g_autoptr(GFile) dir = NULL; g_autoptr(GFileEnumerator) enumerator = NULL; @@ -301,6 +297,9 @@ add_faces_from_dirs (GListStore *faces, GStrv facesdirs, gboolean add_all) } while (TRUE) { + GFile *file; + GFileType type; + const gchar *target; g_autoptr(GFileInfo) info = g_file_enumerator_next_file (enumerator, NULL, NULL); if (info == NULL) { break; @@ -312,7 +311,8 @@ add_faces_from_dirs (GListStore *faces, GStrv facesdirs, gboolean add_all) continue; } - target = g_file_info_get_symlink_target (info); + target = g_file_info_get_attribute_byte_string (info, + G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET); if (target != NULL && g_str_has_prefix (target , "legacy/")) { continue; }