Merge pull request #28 from l4zs/master
change the way of avoiding an IndexOutOfBoundsException
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user