From 6a06e444618dea53aa45285b77264af802f89507 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Sat, 10 May 2008 10:29:35 +0200 Subject: [PATCH] [markup] Check for error before warning Signed-off-by: Julien Danjou --- common/markup.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/common/markup.c b/common/markup.c index 485558484..ca1bc993b 100644 --- a/common/markup.c +++ b/common/markup.c @@ -238,8 +238,9 @@ markup_parse(markup_parser_data_t *data, const char *str, ssize_t slen) || !g_markup_parse_context_parse(mkp_ctx, "", -1, &error) || !g_markup_parse_context_end_parse(mkp_ctx, &error)) { - warn("unable to parse text \"%s\": %s\n", str, error->message); - g_error_free(error); + warn("unable to parse text \"%s\": %s\n", str, error ? error->message : "unknown error"); + if(error) + g_error_free(error); g_markup_parse_context_free(mkp_ctx); return false; }