Skip to content

Commit

Permalink
change the way of avoiding an IndexOutOfBoundsException
Browse files Browse the repository at this point in the history
  • Loading branch information
l4zs committed Sep 23, 2021
1 parent b7d6523 commit 3b04ea7
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ abstract class AbstractGUISpaceCompound<T : ForInventory, E> internal constructo

private fun recalculateCurrentContent() {
if (scrollProgress > content.size)
throw IllegalStateException("The scrollProgress is greater than the content size.")
scrollProgress = content.size
// avoid IndexOutOfBoundsException
var sliceUntil = internalSlots.size + scrollProgress
if (sliceUntil > content.lastIndex)
Expand Down

0 comments on commit 3b04ea7

Please sign in to comment.