From cfe5021dc9c7a36ef76ca05448166f1a97b045de Mon Sep 17 00:00:00 2001 From: Harish Krishnaswamy Date: Tue, 18 Jan 2005 08:58:02 +0000 Subject: handle error conditions more gracefully. 2005-01-18 Harish Krishnaswamy * gui/dialogs/cal-attachment-bar.c (cal_attachment_bar_get_attachment_list): handle error conditions more gracefully. svn path=/trunk/; revision=28432 --- calendar/gui/dialogs/cal-attachment-bar.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'calendar/gui') diff --git a/calendar/gui/dialogs/cal-attachment-bar.c b/calendar/gui/dialogs/cal-attachment-bar.c index daca395904..57c0cab5f1 100644 --- a/calendar/gui/dialogs/cal-attachment-bar.c +++ b/calendar/gui/dialogs/cal-attachment-bar.c @@ -804,12 +804,14 @@ cal_attachment_bar_get_attachment_list (CalAttachmentBar *bar) if (fd == -1) { /* TODO handle error conditions */ g_message ("DEBUG: could not open the file descriptor\n"); + continue; } /* write the camel mime part (attachment->body) into the file*/ if (camel_write (fd, buffer, mstream->buffer->len) == -1) { /* TODO handle error condition */ g_message ("DEBUG: camel write failed.\n"); + continue; } list = g_slist_append (list, g_strdup (attach_file_url)); /* do i need to close the fd */ @@ -866,10 +868,12 @@ cal_attachment_bar_set_attachment_list (CalAttachmentBar *bar, GSList *attach_li /* set file name correctly on the display */ attach = g_slist_nth_data (priv->attachments, priv->num_attachments-1); - camel_mime_part_set_filename (attach->body, - attach_filename + strlen (priv->local_attachment_store)+ - strlen (priv->comp_uid) + 1); - update (bar); + if (attach) { + camel_mime_part_set_filename (attach->body, + attach_filename + strlen (priv->local_attachment_store)+ + strlen (priv->comp_uid) + 1); + update (bar); + } } } -- cgit v1.2.3