summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2015-01-28 18:25:32 -0500
committerMatthias Clasen <mclasen@redhat.com>2015-01-28 18:25:32 -0500
commitf211031a9fb47b32feb3dc211f75d3a3c238689a (patch)
treed04dcec844a4bd245b489ec67c7f18a4b48e4ec5
parente31e88582f280917fa79ca201f59dbabe994fdc6 (diff)
downloadgtk+-f211031a9fb47b32feb3dc211f75d3a3c238689a.tar.gz
places sidebar: Make a function NULL-safe
gtk_places_sidebar_set_location's location argument is documented as allow-none, but if one actually passes NULL, a warning results. Fix that.
-rw-r--r--gtk/gtkplacessidebar.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gtk/gtkplacessidebar.c b/gtk/gtkplacessidebar.c
index d6d3dd6000..fecb94f0a2 100644
--- a/gtk/gtkplacessidebar.c
+++ b/gtk/gtkplacessidebar.c
@@ -4790,7 +4790,9 @@ gtk_places_sidebar_set_location (GtkPlacesSidebar *sidebar,
if (sidebar->current_location != NULL)
g_object_unref (sidebar->current_location);
- sidebar->current_location = g_object_ref (location);
+ sidebar->current_location = location;
+ if (sidebar->current_location != NULL)
+ g_object_ref (sidebar->current_location);
if (location == NULL)
goto out;