fix put bug

This commit is contained in:
Looly
2021-06-15 17:01:27 +08:00
parent 6aba52fda8
commit 1755bbadcc
4 changed files with 35 additions and 15 deletions

View File

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