Skip to content

Commit

Permalink
decode CBOR's undefined to null
Browse files Browse the repository at this point in the history
Bleh. We're not going to round-trip this but we shouldn't hit this anyways.

Alternatively, we could just return an error. However, that may break things for
some users...

fixes #43
  • Loading branch information
Stebalien committed Nov 14, 2018
1 parent 2700834 commit ede3ae2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cbor/cborDecoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ func (d *Decoder) step_acceptMapValue(tokenSlot *Token) (done bool, err error) {

func (d *Decoder) stepHelper_acceptValue(majorByte byte, tokenSlot *Token) (done bool, err error) {
switch majorByte {
case cborSigilNil:
case cborSigilNil, cborSigilUndefined:
tokenSlot.Type = TNull
return true, nil
case cborSigilFalse:
Expand Down

0 comments on commit ede3ae2

Please sign in to comment.