Have a more descriptive exception when trying to access a slice of an empty spread

This has been a first-world problem for quite a while:
if you do this:

MySpread.SliceCount = 0;
return MySpread[0]

naturally and righteously you get an exception. unfortunately though you get a DivisionByZero exception from ZMod and not an OutOfBoundsException from something spread related telling with a message like “Slice indexing operation on empty spread”. It happens sometime during development (or at places where NIL is not expected) and it would be nice to immediately know that this is not a regular division by zero.
Feature request: can we have that?
thanks

1 Like

Indeed. Fixed in upcoming.

3 Likes

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.