aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2011-01-06 22:52:23 +0800
committerRodrigo Moya <rodrigo@gnome-db.org>2011-06-30 00:41:15 +0800
commit824a754c584da12cce2032c85dc49207d469dbb4 (patch)
treeb26495a37c207add7eb5253f4ca196fc997c183c
parent96f515318489ed04b1383b252ee0d0aed237e4f0 (diff)
downloadgsoc2013-evolution-824a754c584da12cce2032c85dc49207d469dbb4.tar.gz
gsoc2013-evolution-824a754c584da12cce2032c85dc49207d469dbb4.tar.zst
gsoc2013-evolution-824a754c584da12cce2032c85dc49207d469dbb4.zip
Bug #633854 - [templates] Crash in build_template_menus_recurse
-rw-r--r--plugins/templates/templates.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/plugins/templates/templates.c b/plugins/templates/templates.c
index 625c70245b..9b664bbe55 100644
--- a/plugins/templates/templates.c
+++ b/plugins/templates/templates.c
@@ -567,10 +567,10 @@ build_template_menus_recurse (GtkUIManager *ui_manager,
gchar *path;
guint ii;
+ folder_name = folder_info->name;
/* FIXME Not passing a GCancellable or GError here. */
folder = camel_store_get_folder_sync (
store, folder_info->full_name, 0, NULL, NULL);
- folder_name = camel_folder_get_name (folder);
action_name = g_strdup_printf (
"templates-menu-%d", *action_count);
@@ -603,9 +603,15 @@ build_template_menus_recurse (GtkUIManager *ui_manager,
path, action_count, merge_id,
folder_info->child, message_folder, message_uid);
+ if (!folder) {
+ g_free (path);
+ folder_info = folder_info->next;
+ continue;
+ }
+
/* Get the UIDs for this folder and add them to the menu. */
uids = camel_folder_get_uids (folder);
- for (ii = 0; ii < uids->len; ii++) {
+ for (ii = 0; uids && ii < uids->len; ii++) {
CamelMimeMessage *template;
const gchar *uid = uids->pdata[ii], *muid;
guint32 flags;
@@ -666,8 +672,9 @@ build_template_menus_recurse (GtkUIManager *ui_manager,
g_object_unref (action);
g_free (action_name);
}
- camel_folder_free_uids (folder, uids);
+ camel_folder_free_uids (folder, uids);
+ g_object_unref (folder);
g_free (path);
folder_info = folder_info->next;