fix add bug

This commit is contained in:
Looly
2021-09-29 10:12:58 +08:00
parent fb87346d8a
commit 6002a1476f
3 changed files with 11 additions and 1 deletions

View File

@@ -449,7 +449,7 @@ public class JSONArray implements JSON, JSONGetter<Integer>, List<Object>, Rando
*/
@Override
public Object set(int index, Object element) {
if(index > size()){
if(index >= size()){
add(index, element);
}
return this.rawList.set(index, JSONUtil.wrap(element, this.config));