]> Pileus Git - ~andy/gtk/commitdiff
cssvalue: Don't crash when printing NULL strings
authorBenjamin Otte <otte@redhat.com>
Thu, 27 Sep 2012 14:23:53 +0000 (16:23 +0200)
committerBenjamin Otte <otte@redhat.com>
Fri, 28 Sep 2012 16:27:49 +0000 (18:27 +0200)
A NULL string should be printed as "none".

gtk/gtkcssstringvalue.c

index 9edda646c9cfd04fdec21b34ebdaf5f89d746d45..02405f4106f1cf1f23b64df25ae3bca230d6e709 100644 (file)
@@ -65,6 +65,12 @@ gtk_css_value_string_print (const GtkCssValue *value,
   char *string = value->string;
   gsize len;
 
+  if (string == NULL)
+    {
+      g_string_append (str, "none");
+      return;
+    }
+
   g_string_append_c (str, '"');
 
   do {