[glib: 2/4] gfileenumerator: Upgrade existing warning to critical warning
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib: 2/4] gfileenumerator: Upgrade existing warning to critical warning
- Date: Thu, 21 Oct 2021 11:58:33 +0000 (UTC)
commit e508a0a8df872cbf1632f8723cbf08c855d6cac0
Author: Philip Withnall <pwithnall endlessos org>
Date: Thu Oct 21 11:11:35 2021 +0100
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
gio/gfileenumerator.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/gio/gfileenumerator.c b/gio/gfileenumerator.c
index 3c10702a7..6d651745c 100644
--- a/gio/gfileenumerator.c
+++ b/gio/gfileenumerator.c
@@ -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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]