better
This commit is contained in:
1 parent
7ee313134e
commit
a7770abf9d
1 file changed
+3
-9
@@ -437,15 +437,9 @@ public class ListValue extends AbstractListValue implements ContainerValueInterf
|
|||||||
public Value get(Value value)
|
public Value get(Value value)
|
||||||
{
|
{
|
||||||
long index = NumericValue.asNumber(value, "'address' to a list index").getLong();
|
long index = NumericValue.asNumber(value, "'address' to a list index").getLong();
|
||||||
try
|
int size = items.size();
|
||||||
{
|
if (size == 0) return Value.NULL;
|
||||||
return items.get(normalizeIndex(index, items.size()));
|
return items.get(normalizeIndex(index, size));
|
||||||
}
|
|
||||||
catch (ArithmeticException are)
|
|
||||||
{
|
|
||||||
if (items.isEmpty()) return Value.NULL;
|
|
||||||
throw are;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in new issue
Block a user