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 769206 - docs: Clarify when NULL might be returned
docs: Clarify when NULL might be returned
Status: RESOLVED FIXED
Product: json-glib
Classification: Core
Component: general
git master
Other All
: Normal normal
: ---
Assigned To: json-glib-maint
json-glib-maint
Depends on:
Blocks:
 
 
Reported: 2016-07-26 20:28 UTC by Matthew Leeds
Modified: 2017-03-18 19:10 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
docs: Clarify when NULL might be returned (3.35 KB, patch)
2016-07-26 20:28 UTC, Matthew Leeds
committed Details | Review

Description Matthew Leeds 2016-07-26 20:28:36 UTC
I think intuitively you might think an empty list would be returned by
json_object_get_members() when the object doesn't have any members, so
the docs should make it clear that NULL will be returned instead.
Comment 1 Matthew Leeds 2016-07-26 20:28:39 UTC
Created attachment 332180 [details] [review]
docs: Clarify when NULL might be returned

If a JsonObject has no members, json_object_get_members() and
json_object_get_values() will return NULL, so this commit makes that
behavior clear in the docs. It also adds the (nullable) annotation in a
few places in the same file.
Comment 2 Emmanuele Bassi (:ebassi) 2017-03-18 19:03:17 UTC
A NULL GList *is* an empty list — the GList API will gladly accept NULL as a valid list.
Comment 3 Emmanuele Bassi (:ebassi) 2017-03-18 19:10:03 UTC
Attachment 332180 [details] pushed as 43001a9 - docs: Clarify when NULL might be returned