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() {
|
private fun recalculateCurrentContent() {
|
||||||
if (scrollProgress > content.size)
|
if (scrollProgress > content.size)
|
||||||
throw IllegalStateException("The scrollProgress is greater than the content size.")
|
scrollProgress = content.size
|
||||||
// avoid IndexOutOfBoundsException
|
// avoid IndexOutOfBoundsException
|
||||||
var sliceUntil = internalSlots.size + scrollProgress
|
var sliceUntil = internalSlots.size + scrollProgress
|
||||||
if (sliceUntil > content.lastIndex)
|
if (sliceUntil > content.lastIndex)
|
||||||
|
Reference in New Issue
Block a user