[gvfs] ftp: Handle NULL progress_callback cases



commit 4cec621168a9e79f639e59eebc9de677ef4a9180
Author: Tomas Bzatek <tbzatek redhat com>
Date:   Mon Aug 15 14:46:03 2011 +0200

    ftp: Handle NULL progress_callback cases
    
    Just be precautious as we already test for this on other places.
    Found by Coverity Scan analysis

 daemon/gvfsbackendftp.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/daemon/gvfsbackendftp.c b/daemon/gvfsbackendftp.c
index d24b259..a715ec4 100644
--- a/daemon/gvfsbackendftp.c
+++ b/daemon/gvfsbackendftp.c
@@ -1442,7 +1442,8 @@ ftp_output_stream_splice (GOutputStream *output,
               g_cancellable_reset (timer_cancel);
               current = cancellable;
               g_clear_error (error);
-              progress_callback (bytes_copied, total_size, progress_callback_data);
+              if (progress_callback)
+                progress_callback (bytes_copied, total_size, progress_callback_data);
               continue;
             }
           else
@@ -1467,7 +1468,8 @@ ftp_output_stream_splice (GOutputStream *output,
                   g_cancellable_reset (timer_cancel);
                   current = cancellable;
                   g_clear_error (error);
-                  progress_callback (bytes_copied, total_size, progress_callback_data);
+                  if (progress_callback)
+                    progress_callback (bytes_copied, total_size, progress_callback_data);
                   continue;
                 }
               else



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]