mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 03:16:17 +01:00
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:
parent
0630272388
commit
e508a0a8df
@ -662,7 +662,10 @@ g_file_enumerator_iterate (GFileEnumerator *direnum,
|
|||||||
const char *name = g_file_info_get_name (ret_info);
|
const char *name = g_file_info_get_name (ret_info);
|
||||||
|
|
||||||
if (G_UNLIKELY (name == NULL))
|
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
|
else
|
||||||
{
|
{
|
||||||
*out_child = g_file_get_child (g_file_enumerator_get_container (direnum), name);
|
*out_child = g_file_get_child (g_file_enumerator_get_container (direnum), name);
|
||||||
|
Loading…
Reference in New Issue
Block a user