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.
This commit is contained in:
Matthias Clasen 2015-01-28 18:25:32 -05:00
parent e31e88582f
commit f211031a9f

View File

@ -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;