After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 725327 - Clicking "add to collection" leads to crash
Clicking "add to collection" leads to crash
Status: RESOLVED FIXED
Product: gnome-photos
Classification: Applications
Component: general
3.11.x
Other All
: Normal normal
: ---
Assigned To: GNOME photos maintainer(s)
GNOME photos maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2014-02-27 15:16 UTC by Debarshi Ray
Modified: 2014-03-03 14:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
organize-collection-view: Watch out for NULL in cell_data_func (1.26 KB, patch)
2014-02-27 15:17 UTC, Debarshi Ray
none Details | Review
base-manager: Watch out for NULL ids (964 bytes, patch)
2014-03-02 10:37 UTC, Debarshi Ray
committed Details | Review

Description Debarshi Ray 2014-02-27 15:16:01 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.
Comment 1 Debarshi Ray 2014-02-27 15:17:56 UTC
Created attachment 270482 [details] [review]
organize-collection-view: Watch out for NULL in cell_data_func
Comment 2 Pranav Kant 2014-02-27 19:34:13 UTC
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.
Comment 3 Debarshi Ray 2014-03-02 10:35:50 UTC
(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.
Comment 4 Debarshi Ray 2014-03-02 10:37:27 UTC
Created attachment 270688 [details] [review]
base-manager: Watch out for NULL ids