diff options
Diffstat (limited to 'libempathy/empathy-log-manager.c')
-rw-r--r-- | libempathy/empathy-log-manager.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/libempathy/empathy-log-manager.c b/libempathy/empathy-log-manager.c index 68e20c8da..ca5297ea7 100644 --- a/libempathy/empathy-log-manager.c +++ b/libempathy/empathy-log-manager.c @@ -331,7 +331,7 @@ empathy_log_manager_get_last_messages (EmpathyLogManager *manager, McAccount *account, const gchar *chat_id) { - GList *messages; + GList *messages = NULL; GList *dates; GList *l; @@ -342,10 +342,12 @@ empathy_log_manager_get_last_messages (EmpathyLogManager *manager, dates = empathy_log_manager_get_dates (manager, account, chat_id); l = g_list_last (dates); - messages = empathy_log_manager_get_messages_for_date (manager, - account, - chat_id, - l->data); + if (l) { + messages = empathy_log_manager_get_messages_for_date (manager, + account, + chat_id, + l->data); + } g_list_foreach (dates, (GFunc) g_free, NULL); g_list_free (dates); |