summaryrefslogtreecommitdiff
path: root/gtk/gtkbuilderparser.c
diff options
context:
space:
mode:
Diffstat (limited to 'gtk/gtkbuilderparser.c')
-rw-r--r--gtk/gtkbuilderparser.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/gtk/gtkbuilderparser.c b/gtk/gtkbuilderparser.c
index 25b3479946..ea2df67e64 100644
--- a/gtk/gtkbuilderparser.c
+++ b/gtk/gtkbuilderparser.c
@@ -139,6 +139,24 @@ error_invalid_tag (ParserData *data,
line_number, char_number, tag);
}
+static void
+error_missing_property_value (ParserData *data,
+ GError **error)
+{
+ gint line_number, char_number;
+
+ g_markup_parse_context_get_position (data->ctx,
+ &line_number,
+ &char_number);
+
+ g_set_error (error,
+ GTK_BUILDER_ERROR,
+ GTK_BUILDER_ERROR_MISSING_PROPERTY_VALUE,
+ "%s:%d:%d <property> must have a value set",
+ data->filename,
+ line_number, char_number);
+}
+
static GObject *
builder_construct (ParserData *data,
ObjectInfo *object_info)
@@ -707,6 +725,12 @@ end_element (GMarkupParseContext *context,
PropertyInfo *prop_info = state_pop_info (data, PropertyInfo);
CommonInfo *info = state_peek_info (data, CommonInfo);
+ if (!prop_info->data)
+ {
+ error_missing_property_value (data, error);
+ return;
+ }
+
/* Normal properties */
if (strcmp (info->tag.name, "object") == 0)
{