[gvfs/mtp-1.14.0: 17/49] Fix crash when called with no progress callback.



commit df6556b1997ece8a799dd5a33024f174ec52bf51
Author: Philip Langdale <philipl cloudera com>
Date:   Thu Aug 9 14:47:50 2012 -0700

    Fix crash when called with no progress callback.

 daemon/gvfsbackendmtp.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/daemon/gvfsbackendmtp.c b/daemon/gvfsbackendmtp.c
index 8980e6d..12a9482 100644
--- a/daemon/gvfsbackendmtp.c
+++ b/daemon/gvfsbackendmtp.c
@@ -681,7 +681,9 @@ typedef struct {
 static int mtp_progress (uint64_t const sent, uint64_t const total,
                   MtpProgressData const * const data)
 {
-  data->progress_callback(sent, total, data->progress_callback_data);
+  if (data->progress_callback) {
+    data->progress_callback(sent, total, data->progress_callback_data);
+  }
   return g_vfs_job_is_cancelled(data->job);
 }
 



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