]> git.0d.be Git - empathy.git/commitdiff
Correctly propagate Provide/Accept errors
authorWill Thompson <will.thompson@collabora.co.uk>
Tue, 9 Jun 2009 17:34:35 +0000 (18:34 +0100)
committerWill Thompson <will.thompson@collabora.co.uk>
Tue, 9 Jun 2009 17:34:35 +0000 (18:34 +0100)
Previously, if myerr was set as well as error, myerr was cleared, but
not set to a copy of error. So then the function continued as normal,
and crashed.

Also, having checked if myerr is set, we should probably log the message
from that, rather than from the (possibly NULL) error. :)

libempathy/empathy-tp-file.c

index 3a58268680fa77fa69c33cbfa5fdd1a85503a418..8b9b9a5e20bf0e40b3a45e7430a8034032552d8e 100644 (file)
@@ -407,13 +407,14 @@ ft_operation_provide_or_accept_file_cb (TpChannel *proxy,
           * report the method error.
           */
           g_clear_error (&myerr);
-          myerr = g_error_copy (error);
         }
+
+      myerr = g_error_copy (error);
     }
 
   if (myerr != NULL)
     {
-      DEBUG ("Error: %s", error->message);
+      DEBUG ("Error: %s", myerr->message);
       ft_operation_close_with_error (tp_file, myerr);
       g_clear_error (&myerr);
       return;