=== modified file 'gio/gsettings.c'
--- old/gio/gsettings.c	2011-09-02 11:20:05 +0000
+++ new/gio/gsettings.c	2011-10-03 13:09:26 +0000
@@ -1620,7 +1620,8 @@ g_settings_get (GSettings   *settings,
   g_variant_get_va (value, format, NULL, &ap);
   va_end (ap);
 
-  g_variant_unref (value);
+  if (value != NULL)
+      g_variant_unref (value);
 }
 
 /**
@@ -1767,7 +1768,8 @@ g_settings_get_string (GSettings   *sett
 
   value = g_settings_get_value (settings, key);
   result = g_variant_dup_string (value, NULL);
-  g_variant_unref (value);
+  if (value != NULL)
+      g_variant_unref (value);
 
   return result;
 }
@@ -1821,7 +1823,8 @@ g_settings_get_int (GSettings   *setting
 
   value = g_settings_get_value (settings, key);
   result = g_variant_get_int32 (value);
-  g_variant_unref (value);
+  if (value != NULL)
+      g_variant_unref (value);
 
   return result;
 }
@@ -1876,7 +1879,8 @@ g_settings_get_uint (GSettings   *settin
 
   value = g_settings_get_value (settings, key);
   result = g_variant_get_uint32 (value);
-  g_variant_unref (value);
+  if (value != NULL)
+      g_variant_unref (value);
 
   return result;
 }
@@ -1931,7 +1935,8 @@ g_settings_get_double (GSettings   *sett
 
   value = g_settings_get_value (settings, key);
   result = g_variant_get_double (value);
-  g_variant_unref (value);
+  if (value != NULL)
+      g_variant_unref (value);
 
   return result;
 }
@@ -1985,7 +1990,8 @@ g_settings_get_boolean (GSettings  *sett
 
   value = g_settings_get_value (settings, key);
   result = g_variant_get_boolean (value);
-  g_variant_unref (value);
+  if (value != NULL)
+      g_variant_unref (value);
 
   return result;
 }
@@ -2039,7 +2045,8 @@ g_settings_get_strv (GSettings   *settin
 
   value = g_settings_get_value (settings, key);
   result = g_variant_dup_strv (value, NULL);
-  g_variant_unref (value);
+  if (value != NULL)
+      g_variant_unref (value);
 
   return result;
 }

