Thanks for fixing this annoying bug. I don't think it's necessary to add a test (you could use Windmill if you really wanted), but I wonder if any consideration has been given to converting this to use LAZR-JS. I very vaguely remember Maris talking about it at some point. Maybe it's worth letting him know that we're now fixing bugs in this legacy code.
The fix looks fine and works well. You can remove the if statement. It is not necessary and I don't think aids readability. Up to you.
Thanks for fixing this annoying bug. I don't think it's necessary to add a test (you could use Windmill if you really wanted), but I wonder if any consideration has been given to converting this to use LAZR-JS. I very vaguely remember Maris talking about it at some point. Maybe it's worth letting him know that we're now fixing bugs in this legacy code.
The fix looks fine and works well. You can remove the if statement. It is not necessary and I don't think aids readability. Up to you.