[gnome-control-center] datetime: don't try to set the timezone if the current location is unknown



commit 4915df9724539e9981aa85bbb5c6b33b07bfef32
Author: Thomas Wood <thomas wood intel com>
Date:   Tue Jun 29 19:16:25 2010 +0100

    datetime: don't try to set the timezone if the current location is unknown

 panels/datetime/cc-datetime-panel.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/panels/datetime/cc-datetime-panel.c b/panels/datetime/cc-datetime-panel.c
index 70a864e..450782b 100644
--- a/panels/datetime/cc-datetime-panel.c
+++ b/panels/datetime/cc-datetime-panel.c
@@ -191,9 +191,13 @@ apply_button_clicked_cb (GtkButton       *button,
 
   set_system_time_async (unixtime, (GFunc) set_time_cb, self, NULL);
 
-  filename = g_build_filename (SYSTEM_ZONEINFODIR, priv->current_location->zone,
-                               NULL);
-  set_system_timezone_async (filename, (GFunc) set_timezone_cb, self, NULL);
+  if (priv->current_location)
+    {
+      filename = g_build_filename (SYSTEM_ZONEINFODIR,
+                                   priv->current_location->zone,
+                                   NULL);
+      set_system_timezone_async (filename, (GFunc) set_timezone_cb, self, NULL);
+    }
 }
 
 static void



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