From c7115084c04a7595ce099c92cf8debc9cf8c3779 Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Fri, 17 Apr 2015 18:28:20 +0200 Subject: [PATCH] log-iter-xml: Fix crash when unable to parse a file Thanks to Daniel Thompson for catching this! https://bugs.freedesktop.org/show_bug.cgi?id=89595 --- telepathy-logger/log-iter-xml.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/telepathy-logger/log-iter-xml.c b/telepathy-logger/log-iter-xml.c index 1684a74..df531e4 100644 --- a/telepathy-logger/log-iter-xml.c +++ b/telepathy-logger/log-iter-xml.c @@ -81,8 +81,12 @@ tpl_log_iter_xml_get_events (TplLogIter *iter, priv->account, priv->target, priv->type_mask, (GDate *) priv->next_date->data); - priv->next_event = g_list_last (priv->events); priv->next_date = g_list_previous (priv->next_date); + + if (priv->events == NULL) + continue; + + priv->next_event = g_list_last (priv->events); } event = TPL_EVENT (priv->next_event->data); -- 2.1.0