From c0953502e6737cd36877e8564502343ba4fb75ea Mon Sep 17 00:00:00 2001 From: "Dirk-Jan C. Binnema" Date: Mon, 11 Jun 2007 16:25:03 +0000 Subject: [PATCH] * in some cases, cancel_all would core, apparently because cur->data was invalid. now, we don't crash, but give an error on stderr instead pmo-trunk-r2160 --- src/modest-mail-operation-queue.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/modest-mail-operation-queue.c b/src/modest-mail-operation-queue.c index 600438b..faab5c5 100644 --- a/src/modest-mail-operation-queue.c +++ b/src/modest-mail-operation-queue.c @@ -344,7 +344,10 @@ modest_mail_operation_queue_cancel_all (ModestMailOperationQueue *self) for(cur = operations_to_cancel; cur != NULL; cur = cur->next) { /* This triggers a progress_changed signal in which we remove * the operation from the queue. */ - modest_mail_operation_cancel (MODEST_MAIL_OPERATION (cur->data)); + if (!MODEST_IS_MAIL_OPERATION(cur->data)) + g_printerr ("modest: cur->data is not a valid mail operation\n"); + else + modest_mail_operation_cancel (MODEST_MAIL_OPERATION (cur->data)); } g_slist_free(operations_to_cancel); -- 1.7.9.5