prevent IndexOutOfBounds

This commit is contained in:
Milos Kozak 2021-09-20 17:17:01 +02:00
parent 545ff0af6e
commit 71093db68a

View file

@ -97,7 +97,7 @@ class LocalProfilePlugin @Inject constructor(
var numOfProfiles = 0 var numOfProfiles = 0
internal var currentProfileIndex = 0 internal var currentProfileIndex = 0
fun currentProfile(): SingleProfile? = if (numOfProfiles > 0) profiles[currentProfileIndex] else null fun currentProfile(): SingleProfile? = if (numOfProfiles > 0 && currentProfileIndex < numOfProfiles) profiles[currentProfileIndex] else null
@Synchronized @Synchronized
fun isValidEditState(): Boolean { fun isValidEditState(): Boolean {