gfileenumerator: Upgrade existing warning to critical warning

The code cannot function correctly if the `standard::name` attribute is
not present, so upgrade the existing warning to a critical warning and
return if it fails in `g_file_enumerator_iterate()`.

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

Helps: #2507
This commit is contained in:
Philip Withnall 2021-10-21 11:11:35 +01:00
parent 0630272388
commit e508a0a8df

View File

@ -662,7 +662,10 @@ g_file_enumerator_iterate (GFileEnumerator *direnum,
const char *name = g_file_info_get_name (ret_info);
if (G_UNLIKELY (name == NULL))
g_warning ("g_file_enumerator_iterate() created without standard::name");
{
g_critical ("g_file_enumerator_iterate() created without standard::name");
g_return_val_if_reached (FALSE);
}
else
{
*out_child = g_file_get_child (g_file_enumerator_get_container (direnum), name);