Skip to content

Commit 145bda2

Browse files
committed
Fixed fromObject() for google.protobuf.Any types.
fromObject() must also be used when encoding the any type, because otherwise string enums will not be serialized correctly.
1 parent 8c6a597 commit 145bda2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/wrappers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ wrappers[".google.protobuf.Any"] = {
4747
if (type)
4848
return this.create({
4949
type_url: object["@type"],
50-
value: type.encode(object).finish()
50+
value: type.encode(type.fromObject(object)).finish()
5151
});
5252
}
5353

0 commit comments

Comments
 (0)