GNOME Bugzilla – Bug 725327
Clicking "add to collection" leads to crash
Last modified: 2014-03-03 14:00:14 UTC
The reason is that the cell_data_func can be invoked even for an empty row, ie. when the row has been appended but not yet filled in. So we should watch out for NULL ids. Somehow this was not happening with GNOME 3.10, but I can deterministically reproduce it with gtk+ >= 3.11.5.
Created attachment 270482 [details] [review] organize-collection-view: Watch out for NULL in cell_data_func
Review of attachment 270482 [details] [review]: What if instead of checking id for NULL here, we make photos_base_manager_get_object_by_id() return NULL when id passed to it is NULL. IMO, that is a more cleaner way to do it as it makes sense for photos_base_manager_get_object_by_id() to return NULL when passed a NULL to it. Also, it will avoid any future mistake like this one and further it will also avoid any need for if checks for id in future.
(In reply to comment #2) > Review of attachment 270482 [details] [review]: > > What if instead of checking id for NULL here, we make > photos_base_manager_get_object_by_id() return NULL when id passed to it is > NULL. Good point. Fixed.
Created attachment 270688 [details] [review] base-manager: Watch out for NULL ids