diff options
author | Matthias Clasen <mclasen@redhat.com> | 2021-12-13 19:54:56 +0000 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2021-12-13 19:54:56 +0000 |
commit | e230c9c6f0e5901bf99df8ee5081a75961c2787f (patch) | |
tree | 0fc7b2c833bfb24d2503982926ea322d759e096d | |
parent | 51a72a9c53d965816a2bfc489aafc83f1e8e4d59 (diff) | |
parent | 6d24a2c942408b98e678d7c1b559de613af3d50c (diff) | |
download | gtk+-e230c9c6f0e5901bf99df8ee5081a75961c2787f.tar.gz |
Merge branch 'builder-tool-fixes' into 'main'
buildertool: Fix a possible crash
See merge request GNOME/gtk!4246
-rw-r--r-- | tools/gtk-builder-tool-simplify.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/tools/gtk-builder-tool-simplify.c b/tools/gtk-builder-tool-simplify.c index dfa4eb7097..bb8e1ebd62 100644 --- a/tools/gtk-builder-tool-simplify.c +++ b/tools/gtk-builder-tool-simplify.c @@ -486,7 +486,7 @@ get_attribute_value (Element *element, return element->attribute_values[i]; } - return NULL; + return ""; } static void @@ -549,7 +549,7 @@ get_class_name (Element *element) return get_attribute_value (parent, "class"); } - return NULL; + return ""; } static gboolean @@ -2295,6 +2295,12 @@ simplify_file (const char *filename, return FALSE; } + if (!g_markup_parse_context_end_parse (context, &error)) + { + g_printerr (_("Can't parse ā%sā: %s\n"), filename, error->message); + return FALSE; + } + data.builder = gtk_builder_new (); if (data.convert3to4) |