From 38115497918ad09e7d342254bf8b71939f3eb8ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enrico=20Tr=C3=B6ger?= Date: Sun, 20 Apr 2008 18:28:55 +0200 Subject: [PATCH] Fix crash on startup caused by invalid settings. --- src/main.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main.c b/src/main.c index a4b0715d..1c3a86f7 100644 --- a/src/main.c +++ b/src/main.c @@ -189,12 +189,17 @@ settings_new_from_file (const gchar* filename) "settings", property, enum_value->value_name, NULL); enum_value = g_enum_get_value_by_name (enum_class, string); - g_object_set (settings, property, enum_value->value, NULL); + if (enum_value) + g_object_set (settings, property, enum_value->value, NULL); + else + g_warning (_("Value '%s' is invalid for %s"), + string, property); + g_free (string); g_type_class_unref (enum_class); } else - g_warning ("Unhandled settings property '%s'", property); + g_warning (_("Unhandled settings property '%s'"), property); } return settings; }