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 636673 - g_simple_async_report_error_in_idle should allow object to be NULL
g_simple_async_report_error_in_idle should allow object to be NULL
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gio
unspecified
Other All
: Normal minor
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2010-12-07 06:16 UTC by morshed.nader
Modified: 2010-12-20 16:21 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Document and allow passing of NULL for the object consistently (2.97 KB, patch)
2010-12-10 14:08 UTC, Christian Dywan
accepted-commit_now Details | Review

Description morshed.nader 2010-12-07 06:16:57 UTC
There appears to be a slight inconsistency between how g_simple_async_result_new  and g_simple_async_report_error_in_idle work. The former allows the first parameter, a GObject, to be NULL, while the latter does not. Additionally, g_simple_async_report_take_gerror_in_idle contains the same bug.

Change is as simple as modifying:

g_return_if_fail (G_IS_OBJECT (object));

to

g_return_val_if_fail (!object || G_IS_OBJECT (object), NULL);

for both g_simple_async_report_take_gerror_in_idle and g_simple_async_report_error_in_idle
Comment 1 morshed.nader 2010-12-07 06:20:42 UTC
I should also note that the documentation should also be updated to note that GObject is allowed to be NULL for these functions, as it does for g_simple_async_result_new

Also, g_simple_async_report_gerror_in_idle contains the issue too
Comment 2 Christian Dywan 2010-12-10 14:08:51 UTC
Created attachment 176180 [details] [review]
Document and allow passing of NULL for the object consistently
Comment 3 Matthias Clasen 2010-12-15 02:45:04 UTC
Review of attachment 176180 [details] [review]:

Thanks, please commit
Comment 4 Christian Dywan 2010-12-17 16:41:17 UTC
Pushed.
Comment 5 morshed.nader 2010-12-17 18:39:57 UTC
Looks like g_simple_async_report_gerror_in_idle still has the issue:
http://git.gnome.org/browse/glib/tree/gio/gsimpleasyncresult.c?id=ddc126cf2cbbdbc3a98e7bd397f19fb0ac8c27c4#n1023
Comment 6 Christian Dywan 2010-12-20 16:21:40 UTC
Thanks for pointing out the missing piece, fixed now.