[gnome-photos/gnome-3-22] item-manager: Avoid CRITICALs when favouriting contents of collections



commit 232c3695e488c9a6a6cf1be92b0d5ff4d322e4a5
Author: Debarshi Ray <debarshir gnome org>
Date:   Sat Oct 8 09:07:35 2016 +0200

    item-manager: Avoid CRITICALs when favouriting contents of collections
    
    Favouriting an item inside a collection leads to BaseItem::info-updated
    being emitted for both the item and the collection. When this is done
    while browsing the collection, the collection item is not present
    inside ItemManager because we have cleared out all the collections so
    that we can share the same mode for listing collections and browsing
    them. This leads to:
      CRITICAL **: photos_item_manager_info_updated: assertion
        'updated_item == item' failed
    
    Let's work around this until we have a separate mode for browsing
    collections.
    
    Fallout from 5497a7c67c13509da605bd51de1098101c7a40b7
    
    https://bugzilla.gnome.org/show_bug.cgi?id=770342

 src/photos-item-manager.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/src/photos-item-manager.c b/src/photos-item-manager.c
index eb3fcc2..71fbd41 100644
--- a/src/photos-item-manager.c
+++ b/src/photos-item-manager.c
@@ -374,6 +374,9 @@ photos_item_manager_info_updated (PhotosBaseItem *item, gpointer user_data)
 
   id = photos_filterable_get_id (PHOTOS_FILTERABLE (item));
   updated_item = PHOTOS_BASE_ITEM (photos_base_manager_get_object_by_id (PHOTOS_BASE_MANAGER (self), id));
+  if (updated_item == NULL)
+    return;
+
   g_return_if_fail (updated_item == item);
 
   is_collection = photos_base_item_is_collection (item);


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