From cb018ec047cea6fd97d4d081b39bbcf6ceb3ac9e Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sun, 1 Nov 2020 10:32:13 -0500 Subject: [PATCH] builder-tool: Avoid a crash Be more careful about types that have been removed. I was getting criticals when converting ui files containing GtkToolbars. --- gtk/tools/gtk-builder-tool-simplify.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gtk/tools/gtk-builder-tool-simplify.c b/gtk/tools/gtk-builder-tool-simplify.c index f2f57d8eab..e1e92b7970 100644 --- a/gtk/tools/gtk-builder-tool-simplify.c +++ b/gtk/tools/gtk-builder-tool-simplify.c @@ -589,7 +589,7 @@ static gboolean property_is_boolean (Element *element, MyParserData *data) { - GParamSpec *pspec; + GParamSpec *pspec = NULL; const char *class_name; const char *property_name; int i; @@ -605,7 +605,8 @@ property_is_boolean (Element *element, property_name = (const char *)element->attribute_values[i]; } - pspec = get_property_pspec (data, class_name, property_name, kind); + if (class_name && property_name) + pspec = get_property_pspec (data, class_name, property_name, kind); if (pspec) return G_PARAM_SPEC_VALUE_TYPE (pspec) == G_TYPE_BOOLEAN;