[evolution-data-server] Check ic->status is not NULL	imapx_command_select_done ()
- From: Raul Gutierrez Segales <raulgs src gnome org>
 
- To: commits-list gnome org
 
- Cc: 
 
- Subject: [evolution-data-server] Check ic->status is not NULL	imapx_command_select_done ()
 
- Date: Fri, 26 Aug 2011 13:58:02 +0000 (UTC)
 
commit 094ab8f70b5b9750448c8b65ca32d5282c886460
Author: Raul Gutierrez Segales <rgs collabora co uk>
Date:   Fri Aug 26 10:36:02 2011 +0100
    Check ic->status is not NULL imapx_command_select_done ()
    
    There are ocassions (are they even valid?) in which ic->status
    might be NULL, so we check for that before trying to access
    ic->status->text when calling g_set_error ().
    
    Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=639717
 camel/providers/imapx/camel-imapx-server.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/camel/providers/imapx/camel-imapx-server.c b/camel/providers/imapx/camel-imapx-server.c
index 35a7f15..4a859d8 100644
--- a/camel/providers/imapx/camel-imapx-server.c
+++ b/camel/providers/imapx/camel-imapx-server.c
@@ -2582,12 +2582,16 @@ imapx_command_select_done (CamelIMAPXServer *is, CamelIMAPXCommand *ic)
 				if (ic->error != NULL) {
 					g_propagate_error (&cw->error, ic->error);
 					ic->error = NULL;
-				} else
+				} else {
+					if (ic->status == NULL)
+						/* FIXME: why is ic->status == NULL here? It shouldn't happen. */
+						g_debug ("imapx_command_select_done: ic->status is NULL.");
 					g_set_error (
 						&cw->error, CAMEL_IMAPX_ERROR, 1,
 						"SELECT %s failed: %s",
 						camel_folder_get_full_name (cw->select),
-						ic->status->text? ic->status->text:"<unknown reason>");
+						ic->status && ic->status->text? ic->status->text:"<unknown reason>");
+				}
 				cw->complete (is, cw);
 				cw = cn;
 				cn = cn->next;
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]