Skip to content

Commit 2917f1b

Browse files
committed
Fix array_sort when array has one value. (CMDHELPER-3113)
1 parent b990ac3 commit 2917f1b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/main/java/com/laytonsmith/core/functions/ArrayHandling.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1399,6 +1399,9 @@ public Construct exec(Target t, Environment environment, Construct... args) thro
13991399
CArray ca = (CArray) args[0];
14001400
CArray.SortType sortType = CArray.SortType.REGULAR;
14011401
CClosure customSort = null;
1402+
if(ca.size() <= 1){
1403+
return ca;
1404+
}
14021405
try {
14031406
if (args.length == 2) {
14041407
if(args[1] instanceof CClosure){

0 commit comments

Comments
 (0)