From 0bc6a41b32e6407618083470075dcbeda65e0c90 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Fri, 30 Jun 2023 14:49:06 +0300 Subject: [PATCH] Fix mistake in pblite deserializer --- libgm/pblite/deseralize.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libgm/pblite/deseralize.go b/libgm/pblite/deseralize.go index 377d7c7..5e3e3bb 100644 --- a/libgm/pblite/deseralize.go +++ b/libgm/pblite/deseralize.go @@ -22,6 +22,7 @@ func Deserialize(data []any, m protoreflect.Message) error { var boolean, ok bool switch fieldDescriptor.Kind() { case protoreflect.MessageKind: + ok = true nestedData, ok := val.([]any) if !ok { 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)) case protoreflect.BytesKind: + ok = true bytesBase64, ok := val.(string) if !ok { return fmt.Errorf("expected string at index %d for field %s, got %T", index, fieldDescriptor.FullName(), val)