[gtk+/gtk-3-6] cssprovider: Handle non-existing section



commit 643d1d95410637de6952b374fbff7a0cd68e1ed2
Author: Benjamin Otte <otte redhat com>
Date:   Thu Nov 15 19:18:19 2012 +0100

    cssprovider: Handle non-existing section
    
    Otherwise we'll get warnings on errors when CSS debug is disabled.

 gtk/gtkcssprovider.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkcssprovider.c b/gtk/gtkcssprovider.c
index 12c6a78..ebc2ce4 100644
--- a/gtk/gtkcssprovider.c
+++ b/gtk/gtkcssprovider.c
@@ -1825,9 +1825,12 @@ gtk_css_provider_propagate_error (GtkCssProvider  *provider,
     return;
 
   *propagate_to = g_error_copy (error);
-  s = _gtk_css_section_to_string (section);
-  g_prefix_error (propagate_to, "%s", s);
-  g_free (s);
+  if (section)
+    {
+      s = _gtk_css_section_to_string (section);
+      g_prefix_error (propagate_to, "%s", s);
+      g_free (s);
+    }
 }
 
 static gboolean



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]