Closed badscientist-zz closed 7 years ago
@badscientist wow, I can't believe this one hadn't been reported yet! Also, there was clearly a gap in my testing. I've added a PR for this - once the build server gives me the green light, I'll merge and release a bug fix.
Thanks for the report!
I just published 4.2.3
for this. Thanks again for the report!
Line: 679: if index <= list.count {
Using
<=
in this condition is causing a crash when the user attempts to select a non-existent value that exceeds list.count. This is happening becauselist.count
does not factor in that array indexes begin at zero.Example, if
list.count
returns5
and the user is requesting the value with an index key of 5, this condition (line 679) will succeed but, because the fifth value inlist
has an index key of4
, line680: return .element(list[index])
will fail and cause a crash.I made the following simple change and it fixed this crash:
Line: 679: if index < list.count {
Oh, and thanks for project btw!