From f31d0fbeda0c03a619c2db2a84ef3181c579649b Mon Sep 17 00:00:00 2001 From: Will Thompson Date: Tue, 9 Jun 2009 18:34:35 +0100 Subject: [PATCH] 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. :) --- libempathy/empathy-tp-file.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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; -- 2.39.2