提交 083bf240 编写于 作者: C Christopher Cizek

Fix support for protobuf 3.5+, ExtensionRegistry cannot be null

上级 911a5d48
......@@ -36,7 +36,8 @@ final class ProtoResponseBodyConverter<T extends MessageLite>
@Override public T convert(ResponseBody value) throws IOException {
try {
return parser.parseFrom(value.byteStream(), registry);
return registry == null ? parser.parseFrom(value.byteStream())
: parser.parseFrom(value.byteStream(), registry);
} catch (InvalidProtocolBufferException e) {
throw new RuntimeException(e); // Despite extending IOException, this is data mismatch.
} finally {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册