[gtk/matthiasc/for-master] builder-tool: Avoid a crash
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/matthiasc/for-master] builder-tool: Avoid a crash
- Date: Sun, 1 Nov 2020 19:55:06 +0000 (UTC)
commit ef31458fc0b747a575ac260fc661d850f5defa57
Author: Matthias Clasen <mclasen redhat com>
Date: Sun Nov 1 10:32:13 2020 -0500
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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]