gio-tool-info: Add missing attribute check

`g_file_info_get_is_hidden()` should not be called without checking the
attribute is set first, just as with the calls higher up in this code.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Helps: #2907
This commit is contained in:
Philip Withnall 2023-02-08 10:28:35 +00:00
parent ed8e86a7d4
commit 7082f03dbf

View File

@ -196,7 +196,8 @@ show_info (GFile *file, GFileInfo *info)
g_print (" %"G_GUINT64_FORMAT"\n", (guint64)size);
}
if (g_file_info_get_is_hidden (info))
if (g_file_info_has_attribute (info, G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN) &&
g_file_info_get_is_hidden (info))
g_print (_("hidden\n"));
uri = g_file_get_uri (file);