Came across this bug while running code on Lucee 6.1.0.243, it’s a bad error message from ListDeleteAt(), which when you use an out-of-bounds list index, gives you the wrong allowable range. For example:
<cfset my_list = "A,B,C,D,E">
<cfset my_list = ListDeleteAt(my_list,6)>
This will give the following error message:
“Invalid call of the function [ListDeleteAt], second Argument [index] is invalid, index must be an integer between 1 and 4”
No, the actual allowable range is 1-5.
I’ve tried this with a one-element list too, same thing happens, the high end of the stated range is 1 less than it should be, in this case zero:
<cfset my_list = "A">
<cfset my_list = ListDeleteAt(my_list,2)>
Error message: “Invalid call of the function [ListDeleteAt], second Argument [index] is invalid, index must be an integer between 1 and 0”
Looks like it’d be a very quick, trivially-easy fix in the underlying Lucee engine code. Just reporting it like a good citizen!