layouts get initialized with text == NULL as an optimization (avoid a
malloc). But pango_layout_set_text (layout, NULL, 0); will set the text
to "", so it is impossible to set a NULL text.
Fxies crashers in various places that assume NULL return values never
happen.
https://bugzilla.gnome.org/show_bug.cgi?id=707659
{
g_return_val_if_fail (PANGO_IS_LAYOUT (layout), NULL);
+ /* We don't ever want to return NULL as the text.
+ */
+ if (G_UNLIKELY (!layout->text))
+ return "";
+
return layout->text;
}