修复value为null,终止解析的bug

master
剑器近 2020-12-18 14:06:19 +08:00
parent 776bea7067
commit a7247d2ce3
1 changed files with 1 additions and 2 deletions

View File

@ -1,7 +1,7 @@
package io.github.yezhihao.protostar.converter;
import io.netty.buffer.ByteBuf;
import io.github.yezhihao.protostar.util.ByteBufUtils;
import io.netty.buffer.ByteBuf;
import java.util.Map;
import java.util.TreeMap;
@ -27,7 +27,6 @@ public abstract class MapConverter<K, V> implements Converter<Map<K, V>> {
K id = readKey(input);
int len = ByteBufUtils.readInt(input, valueSize());
Object value = convert(id, input.readSlice(len));
if (value == null) break;
map.put(id, (V) value);
} while (input.isReadable());
return map;