[markup] Check for error before warning
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
48482f3712
commit
6a06e44461
|
@ -238,8 +238,9 @@ markup_parse(markup_parser_data_t *data, const char *str, ssize_t slen)
|
||||||
|| !g_markup_parse_context_parse(mkp_ctx, "</markup>", -1, &error)
|
|| !g_markup_parse_context_parse(mkp_ctx, "</markup>", -1, &error)
|
||||||
|| !g_markup_parse_context_end_parse(mkp_ctx, &error))
|
|| !g_markup_parse_context_end_parse(mkp_ctx, &error))
|
||||||
{
|
{
|
||||||
warn("unable to parse text \"%s\": %s\n", str, error->message);
|
warn("unable to parse text \"%s\": %s\n", str, error ? error->message : "unknown error");
|
||||||
g_error_free(error);
|
if(error)
|
||||||
|
g_error_free(error);
|
||||||
g_markup_parse_context_free(mkp_ctx);
|
g_markup_parse_context_free(mkp_ctx);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue