repository: Ensure error is set if we're parsing a malformed file

https://bugzilla.gnome.org/show_bug.cgi?id=661951
This commit is contained in:
Jean Bréfort 2012-02-17 11:48:35 -05:00 committed by Colin Walters
parent a714bef965
commit 4359a037db

View File

@ -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;
}