[gnome-control-center] region: Avoid crash when systemd is not available



commit a0f6f9c603d5dee061f8294d68da93f994d44f6d
Author: Rodrigo Moya <rodrigo gnome-db org>
Date:   Tue Aug 23 13:01:06 2011 +0200

    region: Avoid crash when systemd is not available

 panels/region/gnome-region-panel-system.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/panels/region/gnome-region-panel-system.c b/panels/region/gnome-region-panel-system.c
index d76d6b2..d12e10d 100644
--- a/panels/region/gnome-region-panel-system.c
+++ b/panels/region/gnome-region-panel-system.c
@@ -114,6 +114,7 @@ on_localed_properties_changed (GDBusProxy   *proxy,
 {
         GVariant *res;
         GVariant *v;
+	GError *error = NULL;
 
         res = g_dbus_connection_call_sync (g_dbus_proxy_get_connection (proxy),
                                            g_dbus_proxy_get_name (proxy),
@@ -125,7 +126,13 @@ on_localed_properties_changed (GDBusProxy   *proxy,
                                                           "Locale"),
                                            NULL,
                                            G_DBUS_CALL_FLAGS_NONE,
-                                           -1, NULL, NULL);
+                                           -1, NULL, &error);
+	if (!res) {
+		g_warning ("Failed to call Get method: %s", error->message);
+		g_error_free (error);
+		return;
+	}
+
         v = g_variant_get_child_value (res, 0);
         if (v) {
                 const gchar **strv;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]