summaryrefslogtreecommitdiff
path: root/girepository/girparser.c
diff options
context:
space:
mode:
authorJean Bréfort <jean.brefort@normalesup.org>2012-02-17 11:48:35 -0500
committerColin Walters <walters@verbum.org>2012-02-17 11:48:35 -0500
commit4fbb34bb0ea4a1d142052e62a29480c704550f8b (patch)
tree2e9c3b750da66a1ba3afd64735956c013f91472d /girepository/girparser.c
parent4170ebb550c90249e0458410c59366af363cabe5 (diff)
downloadgobject-introspection-4fbb34bb0ea4a1d142052e62a29480c704550f8b.tar.gz
repository: Ensure error is set if we're parsing a malformed file
https://bugzilla.gnome.org/show_bug.cgi?id=661951
Diffstat (limited to 'girepository/girparser.c')
-rw-r--r--girepository/girparser.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/girepository/girparser.c b/girepository/girparser.c
index 041c65d7..fa0de1f8 100644
--- a/girepository/girparser.c
+++ b/girepository/girparser.c
@@ -3511,10 +3511,11 @@ _g_ir_parser_parse_string (GIrParser *parser,
if (ctx.modules)
return ctx.modules->data;
- g_set_error (error,
- G_MARKUP_ERROR,
- G_MARKUP_ERROR_INVALID_CONTENT,
- "Expected namespace element in the gir file");
+ if (error && *error == NULL)
+ g_set_error (error,
+ G_MARKUP_ERROR,
+ G_MARKUP_ERROR_INVALID_CONTENT,
+ "Expected namespace element in the gir file");
return NULL;
}