From: Will Thompson Date: Tue, 9 Jun 2009 17:34:35 +0000 (+0100) Subject: Correctly propagate Provide/Accept errors X-Git-Url: https://git.0d.be/?p=empathy.git;a=commitdiff_plain;h=f31d0fbeda0c03a619c2db2a84ef3181c579649b Correctly propagate Provide/Accept errors 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. :) --- diff --git a/libempathy/empathy-tp-file.c b/libempathy/empathy-tp-file.c index 3a582686..8b9b9a5e 100644 --- a/libempathy/empathy-tp-file.c +++ b/libempathy/empathy-tp-file.c @@ -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;