diff --git a/src/main/java/com/laytonsmith/core/functions/ArrayHandling.java b/src/main/java/com/laytonsmith/core/functions/ArrayHandling.java index 2fed412db..8519dae97 100644 --- a/src/main/java/com/laytonsmith/core/functions/ArrayHandling.java +++ b/src/main/java/com/laytonsmith/core/functions/ArrayHandling.java @@ -1826,9 +1826,12 @@ private CArray merge(CArray left, CArray right, CClosure closure, Target t) { } else { value = -1; } + } else if(c.isInstanceOf(CInt.TYPE)) { + long longVal = ((CInt) c).getInt(); + value = (longVal > 0 ? 1 : (longVal < 0 ? -1 : 0)); } else { throw new CRECastException("The custom closure did not return a value (or returned an invalid" - + " type). It must always return true, false, or null.", t); + + " type). It must always return true, false, null, or an integer.", t); } if(value <= 0) { result.push(left.get(0, t), t);