hankhero / cl-json

Json encoder and decoder for Common-Lisp
Other
76 stars 39 forks source link

Decoder chokes on NIL input #30

Open samuel-jimenez opened 4 years ago

samuel-jimenez commented 4 years ago

The following code: (json:decode-json-from-string nil)

gives an error:

 The value
    NIL
  is not of type
    STRING
  when binding STRING

when it should return NIL

rpgoldman commented 4 years ago

This doesn't look like a bug to me, and here's why:

> (stringp nil)
NIL

so passing NIL to decode-json-from-string is a type error, not something that should return NIL.

Why do you think this should not be an error?