[gnome-photos] collection-icon-watcher: We can't add a weak reference to NULL
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos] collection-icon-watcher: We can't add a weak reference to NULL
- Date: Thu, 7 May 2015 18:18:09 +0000 (UTC)
commit adf2c615689c0ff072a04db081faef8ff3575b66
Author: Debarshi Ray <debarshir gnome org>
Date: Thu May 7 20:11:01 2015 +0200
collection-icon-watcher: We can't add a weak reference to NULL
src/photos-collection-icon-watcher.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/src/photos-collection-icon-watcher.c b/src/photos-collection-icon-watcher.c
index cdd6e05..beb0cb3 100644
--- a/src/photos-collection-icon-watcher.c
+++ b/src/photos-collection-icon-watcher.c
@@ -396,7 +396,8 @@ photos_collection_icon_watcher_set_property (GObject *object,
{
case PROP_COLLECTION:
priv->collection = PHOTOS_BASE_ITEM (g_value_get_object (value)); /* self is owned by collection */
- g_object_add_weak_pointer (G_OBJECT (priv->collection), (gpointer *) &priv->collection);
+ if (priv->collection != NULL)
+ g_object_add_weak_pointer (G_OBJECT (priv->collection), (gpointer *) &priv->collection);
break;
default:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]