else if (G_VALUE_HOLDS_STRING (value))
{
- if (g_variant_type_equal (expected_type, G_VARIANT_TYPE_STRING))
+ if (g_value_get_string (value) == NULL)
+ return NULL;
+ else if (g_variant_type_equal (expected_type, G_VARIANT_TYPE_STRING))
return g_variant_new_string (g_value_get_string (value));
else if (g_variant_type_equal (expected_type, G_VARIANT_TYPE_OBJECT_PATH))
return g_variant_new_object_path (g_value_get_string (value));
* The binding uses the default GIO mapping functions to map
* between the settings and property values. These functions
* handle booleans, numeric types and string types in a
- * straightforward way. Use g_settings_bind_with_mapping()
- * if you need a custom mapping, or map between types that
- * are not supported by the default mapping functions.
+ * straightforward way. Use g_settings_bind_with_mapping() if
+ * you need a custom mapping, or map between types that are not
+ * supported by the default mapping functions.
*
* Unless the @flags include %G_SETTINGS_BIND_NO_SENSITIVITY, this
* function also establishes a binding between the writability of