File tree Expand file tree Collapse file tree 3 files changed +11
-4
lines changed
persistence/serialization Expand file tree Collapse file tree 3 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ const (
2424
2525 // ServerVersion value can be changed by the create-tag Github workflow.
2626 // If you change the var name or move it, be sure to update the workflow.
27- ServerVersion = "1.29.0-139.0 "
27+ ServerVersion = "1.29.0-139.1 "
2828
2929 // SupportedServerVersions is used by CLI and inter role communication.
3030 SupportedServerVersions = ">=1.0.0 <2.0.0"
Original file line number Diff line number Diff line change @@ -49,9 +49,6 @@ func Decode(data *commonpb.DataBlob, result proto.Message) error {
4949 if data == nil {
5050 return NewDeserializationError (enumspb .ENCODING_TYPE_UNSPECIFIED , errors .New ("cannot decode nil" ))
5151 }
52- if data .Data == nil {
53- return nil
54- }
5552
5653 switch data .EncodingType {
5754 case enumspb .ENCODING_TYPE_JSON :
Original file line number Diff line number Diff line change @@ -42,6 +42,16 @@ func TestProtoDecode(t *testing.T) {
4242 assert .Contains (t , err .Error (), "cannot decode nil" )
4343 })
4444
45+ t .Run ("empty data blob" , func (t * testing.T ) {
46+ blob := & commonpb.DataBlob {}
47+
48+ var result persistencespb.ShardInfo
49+ err := Decode (blob , & result )
50+ require .Error (t , err )
51+ assert .IsType (t , & UnknownEncodingTypeError {}, err )
52+ assert .Contains (t , err .Error (), "unknown or unsupported encoding type Unspecified" )
53+ })
54+
4555 t .Run ("nil data field" , func (t * testing.T ) {
4656 blob := & commonpb.DataBlob {
4757 Data : nil ,
You can’t perform that action at this time.
0 commit comments