Skip to content

Commit

Permalink
Merge pull request #148 from soramitsu/fix/change_pin_crash
Browse files Browse the repository at this point in the history
fix ArrayIndexOutOfBoundsException on pincode screen
  • Loading branch information
ArtemNurtdinov authored Jan 28, 2021
2 parents ea6d500 + b4d24e3 commit aaf845b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class DotsProgressView @JvmOverloads constructor(
for (circle in circles) {
circle?.background = emptyDrawable
}
if (currentProgress == 0) {
if (currentProgress == 0 || currentProgress > MAX_PROGRESS) {
return
}
for (i in 0 until currentProgress) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class PinCodeView @JvmOverloads constructor(
}

private fun pinNumberAdded(number: String) {
if (inputCode.length > DotsProgressView.MAX_PROGRESS) {
if (inputCode.length >= DotsProgressView.MAX_PROGRESS) {
return
} else {
inputCode += number
Expand Down

0 comments on commit aaf845b

Please sign in to comment.