diff options
author | Nicolas Dufresne <nicolas.dufresne@collabora.co.uk> | 2011-02-28 18:31:19 -0500 |
---|---|---|
committer | Nicolas Dufresne <nicolas.dufresne@collabora.co.uk> | 2011-02-28 18:35:56 -0500 |
commit | 01021eaf04b24688423f3ba35b2794b5841c08aa (patch) | |
tree | 6f30196e23cb7df9ab1d46257714b136820f65d3 | |
parent | 0c3483b85b4a571175690a454cb5df0b11b5b3eb (diff) | |
download | telepathy-logger-01021eaf04b24688423f3ba35b2794b5841c08aa.tar.gz |
Set an error if text event body is empty or NULL
this prevent later crash as we where returning FALSE without setting the
error.
-rw-r--r-- | telepathy-logger/log-store-xml.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/telepathy-logger/log-store-xml.c b/telepathy-logger/log-store-xml.c index 99e7f77..cddaf66 100644 --- a/telepathy-logger/log-store-xml.c +++ b/telepathy-logger/log-store-xml.c @@ -484,7 +484,12 @@ add_text_event (TplLogStoreXml *self, body_str = tpl_text_event_get_message (message); if (TPL_STR_EMPTY (body_str)) - goto out; + { + g_set_error (error, TPL_LOG_STORE_ERROR, + TPL_LOG_STORE_ERROR_FAILED, + "The message body is empty or NULL"); + goto out; + } body = g_markup_escape_text (body_str, -1); msg_type = tpl_text_event_get_message_type (message); |