[nautilus/gnome-3-20] progress-info: check destination before referencing it
- From: Răzvan-Mihai Chițu <razvanchitu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/gnome-3-20] progress-info: check destination before referencing it
- Date: Wed, 24 Feb 2016 16:03:59 +0000 (UTC)
commit 168425bda79c995208510b60da990fda273171b9
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]