Merge branch 'builder-tool-fixes' into 'main'

builderparser: Be more robust

See merge request GNOME/gtk!4247
This commit is contained in:
Matthias Clasen 2021-12-13 21:29:48 +00:00
commit a55458a84a

View File

@ -432,6 +432,9 @@ value_is_default (Element *element,
if (g_type_is_a (G_PARAM_SPEC_VALUE_TYPE (pspec), G_TYPE_BOXED))
return FALSE;
if (!value_string)
return FALSE;
if (!gtk_builder_value_from_string (data->builder, pspec, value_string, &value, &error))
{
g_printerr (_("%s:%d: Couldnt parse value for property '%s': %s\n"), data->input_filename, element->line_number, pspec->name, error->message);
@ -2301,6 +2304,12 @@ simplify_file (const char *filename,
return FALSE;
}
if (data.root == NULL)
{
g_printerr (_("Can't parse “%s”\n"), filename);
return FALSE;
}
data.builder = gtk_builder_new ();
if (data.convert3to4)