Fix mistake in pblite deserializer
This commit is contained in:
parent
ceedfb1192
commit
0bc6a41b32
1 changed files with 2 additions and 0 deletions
|
@ -22,6 +22,7 @@ func Deserialize(data []any, m protoreflect.Message) error {
|
||||||
var boolean, ok bool
|
var boolean, ok bool
|
||||||
switch fieldDescriptor.Kind() {
|
switch fieldDescriptor.Kind() {
|
||||||
case protoreflect.MessageKind:
|
case protoreflect.MessageKind:
|
||||||
|
ok = true
|
||||||
nestedData, ok := val.([]any)
|
nestedData, ok := val.([]any)
|
||||||
if !ok {
|
if !ok {
|
||||||
return fmt.Errorf("expected untyped array at index %d for field %s, got %T", index, fieldDescriptor.FullName(), val)
|
return fmt.Errorf("expected untyped array at index %d for field %s, got %T", index, fieldDescriptor.FullName(), val)
|
||||||
|
@ -32,6 +33,7 @@ func Deserialize(data []any, m protoreflect.Message) error {
|
||||||
}
|
}
|
||||||
m.Set(fieldDescriptor, protoreflect.ValueOfMessage(nestedMessage))
|
m.Set(fieldDescriptor, protoreflect.ValueOfMessage(nestedMessage))
|
||||||
case protoreflect.BytesKind:
|
case protoreflect.BytesKind:
|
||||||
|
ok = true
|
||||||
bytesBase64, ok := val.(string)
|
bytesBase64, ok := val.(string)
|
||||||
if !ok {
|
if !ok {
|
||||||
return fmt.Errorf("expected string at index %d for field %s, got %T", index, fieldDescriptor.FullName(), val)
|
return fmt.Errorf("expected string at index %d for field %s, got %T", index, fieldDescriptor.FullName(), val)
|
||||||
|
|
Loading…
Reference in a new issue