From 145bda25ee1de2c0678ce7b8a093669ec2526b1d Mon Sep 17 00:00:00 2001 From: Manfred Rudigier Date: Tue, 23 May 2017 09:17:56 +0200 Subject: [PATCH] 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. --- src/wrappers.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wrappers.js b/src/wrappers.js index 9c31cb706..6253a56c5 100644 --- a/src/wrappers.js +++ b/src/wrappers.js @@ -47,7 +47,7 @@ wrappers[".google.protobuf.Any"] = { if (type) return this.create({ type_url: object["@type"], - value: type.encode(object).finish() + value: type.encode(type.fromObject(object)).finish() }); }