From ede3ae2ed87accd6cd6e6237725a201333a2c546 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Wed, 14 Nov 2018 13:08:58 -0800 Subject: [PATCH] decode CBOR's undefined to null 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 --- cbor/cborDecoder.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cbor/cborDecoder.go b/cbor/cborDecoder.go index 8cc14ff..463fef8 100644 --- a/cbor/cborDecoder.go +++ b/cbor/cborDecoder.go @@ -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: