This reverts commit
f864187bf5fdfaf71f2e038949e403a42e6daf0e.
Reverting this as it changes behaviour and the documentation is
ambiguous about whether the caller must check the type first or
not (call must check type vs. returns NULL if not a string). If
GLib has been compiled with G_DISABLE_CHECKS then g_value_get_string()
may return complete garbage even if the value does not contain
a string. Better play it safe, esp. since the extra check is just
an integer comparison. For fundamental types we could return values
from the GValue structure directly if we really wanted to bypass
the extra check.
if (field == NULL)
return NULL;
+ if (!G_VALUE_HOLDS_STRING (&field->value))
+ return NULL;
return g_value_get_string (&field->value);
}