camel_imapx_command_set_error_if_failed() minor cleanup.
authorMatthew Barnes <mbarnes@redhat.com>
Tue, 21 May 2013 18:32:44 +0000 (14:32 -0400)
committerMatthew Barnes <mbarnes@redhat.com>
Wed, 22 May 2013 13:28:45 +0000 (09:28 -0400)
(cherry picked from commit f6de223967143aae8732bf88a7643bcd49eae27a)

camel/camel-imapx-command.c

index bd42ee7..efe689a 100644 (file)
@@ -582,6 +582,7 @@ camel_imapx_command_set_error_if_failed (CamelIMAPXCommand *ic,
                                          GError **error)
 {
        CamelIMAPXJob *job;
+       GCancellable *cancellable = NULL;
 
        g_return_val_if_fail (CAMEL_IS_IMAPX_COMMAND (ic), FALSE);
 
@@ -610,10 +611,10 @@ camel_imapx_command_set_error_if_failed (CamelIMAPXCommand *ic,
        }
 
        job = camel_imapx_command_get_job (ic);
-       if (job && g_cancellable_set_error_if_cancelled (camel_imapx_job_get_cancellable (job), error))
-               return TRUE;
+       if (job != NULL)
+               cancellable = camel_imapx_job_get_cancellable (job);
 
-       return FALSE;
+       return g_cancellable_set_error_if_cancelled (cancellable, error);
 }
 
 CamelIMAPXCommandQueue *