Is just a safety check which I haven't run into, since the on click event for the arrows is not added when there isn't a previous or next page. So `currentStart` shouldn't be less than 0 or more than the max.

If we keep it, you are right, if the FindInFiles panels isn't visible, then it shouldn't return, but if it is visible, then we can just leave the last page.