[gnome-software] Do not crash if the child schema is invalid
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] Do not crash if the child schema is invalid
- Date: Fri, 4 Aug 2017 17:05:58 +0000 (UTC)
commit 0ac296260bd4018f67eae0c7f25e34ce66cdbd0a
Author: Richard Hughes <richard hughsie com>
Date: Fri Aug 4 18:05:24 2017 +0100
Do not crash if the child schema is invalid
Will help to debug: https://bugzilla.gnome.org/show_bug.cgi?id=781905#c5
src/gs-folders.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/src/gs-folders.c b/src/gs-folders.c
index ca5014e..a05e212 100644
--- a/src/gs-folders.c
+++ b/src/gs-folders.c
@@ -192,6 +192,10 @@ load (GsFolders *folders)
child_path = g_strconcat (path, "folders/", ids[i], "/", NULL);
settings = g_settings_new_with_path (APP_FOLDER_CHILD_SCHEMA, child_path);
+ if (settings == NULL) {
+ g_warning ("ignoring folder child %s as invalid", ids[i]);
+ continue;
+ }
name = g_settings_get_string (settings, "name");
translate = g_settings_get_boolean (settings, "translate");
folder = gs_folder_new (ids[i], name, translate);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]