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 758580 - json_reader_is_value returns TRUE for null type but json_reader_get_value throws an error
json_reader_is_value returns TRUE for null type but json_reader_get_value thr...
Status: RESOLVED FIXED
Product: json-glib
Classification: Core
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: json-glib-maint
json-glib-maint
Depends on:
Blocks:
 
 
Reported: 2015-11-24 09:07 UTC by Robert Ancell
Modified: 2017-03-18 18:56 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Make json_reader_get_value return a value for the null type. This matches the json_reader_is_value check. (962 bytes, patch)
2015-11-24 09:08 UTC, Robert Ancell
committed Details | Review
Test case (670 bytes, text/x-csrc)
2015-11-24 09:16 UTC, Robert Ancell
  Details

Description Robert Ancell 2015-11-24 09:07:09 UTC
If the reader is on a null value:

json_reader_is_value (reader) -> TRUE
json_reader_get_value (reader) -> NULL (and throws an error).

See attached patch that makes get_value check for the null value to match is_value.
Comment 1 Robert Ancell 2015-11-24 09:08:02 UTC
Created attachment 316145 [details] [review]
Make json_reader_get_value return a value for the  null type. This matches the json_reader_is_value check.
Comment 2 Robert Ancell 2015-11-24 09:16:17 UTC
Created attachment 316147 [details]
Test case
Comment 3 Emmanuele Bassi (:ebassi) 2017-03-18 18:56:38 UTC
Thanks for the patch!

I've pushed attachment 316145 [details] [review] to master, and turn the stand alone test case into a unit in the JsonReader test suite.