[nautilus] progress-info: check destination before referencing it



commit 9bc857ce6f8888db32f7abc9f4caebefeabf9a59
Author: Razvan Chitu <razvan ch95 gmail com>
Date:   Wed Feb 24 15:20:49 2016 +0200

    progress-info: check destination before referencing it
    
    The progress info destination is obtainable through a getter function that
    returns a reference to it. This reference is created without checking if the
    destination is not null, which leads to critical warnings. In order to fix this,
    check the destination before creating the reference.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=762609

 libnautilus-private/nautilus-progress-info.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/libnautilus-private/nautilus-progress-info.c b/libnautilus-private/nautilus-progress-info.c
index de913a3..95e7512 100644
--- a/libnautilus-private/nautilus-progress-info.c
+++ b/libnautilus-private/nautilus-progress-info.c
@@ -726,10 +726,12 @@ nautilus_progress_info_set_destination (NautilusProgressInfo *info,
 GFile *
 nautilus_progress_info_get_destination (NautilusProgressInfo *info)
 {
-        GFile *destination;
+        GFile *destination = NULL;
 
         G_LOCK (progress_info);
-        destination = g_object_ref (info->destination);
+        if (info->destination) {
+                destination = g_object_ref (info->destination);
+        }
         G_UNLOCK (progress_info);
 
         return destination;


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