Return nil error on empty slice in (*DecodingLayerParser).DecodeLayers#847
Return nil error on empty slice in (*DecodingLayerParser).DecodeLayers#847tklauser wants to merge 1 commit intogoogle:masterfrom
Conversation
|
If Regarding whether |
Agree, truncating
Yes, in our code we're already checking that. |
Before v1.1.18 passing an empty data slice to (*DecodingLayerParser).DecodeLayers would return a nil error. Commit 04f6565 (PR google#660) changed this behavior, passing the empty data to the to return an error from the first layer that considers an empty slice to be invalid. Strictly speaking this is an API breakage, so restore the previous behavior by returning nil straight away on empty data. Fixes google#846 Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
50bf553 to
9490a53
Compare
Before v1.1.18 passing an empty data slice to
(*DecodingLayerParser).DecodeLayerswould return anilerror. Commit04f6565 (PR #660) changed this behavior, passing the empty data to the
to return an error from the first layer that considers an empty slice to
be invalid.
Strictly speaking this is an API breakage, so restore the previous
behavior by returning nil straight away on empty data.
Fixes #846