mirror of https://github.com/tikv/client-java.git
fix enum index out of range error (#106)
Signed-off-by: birdstorm <samuelwyf@hotmail.com>
This commit is contained in:
parent
a0229f56aa
commit
07e9040130
|
|
@ -723,6 +723,9 @@ public class Codec {
|
|||
}
|
||||
|
||||
public static String readEnumFromIndex(int idx, List<String> elems) {
|
||||
if (idx == 0) {
|
||||
return "";
|
||||
}
|
||||
if (idx < 0 || idx >= elems.size()) throw new TypeException("Index is out of range");
|
||||
return elems.get(idx);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue