Merge pull request #764 from grote/697-receivery-code-crash
Trim white-spaces from recovery code words
This commit is contained in:
commit
5498e838db
1 changed files with 3 additions and 1 deletions
|
@ -61,7 +61,9 @@ internal class RecoveryCodeViewModel(
|
|||
|
||||
@Throws(InvalidWordException::class, ChecksumException::class)
|
||||
fun validateCode(input: List<CharSequence>): Mnemonics.MnemonicCode {
|
||||
val code = Mnemonics.MnemonicCode(input.toMnemonicChars())
|
||||
check(input.size == WORD_NUM) { "Got ${input.size} words instead of $WORD_NUM" }
|
||||
val trimmedInput = input.map { it.trim() } // white-spaces have a meaning in next line
|
||||
val code = Mnemonics.MnemonicCode(trimmedInput.toMnemonicChars())
|
||||
try {
|
||||
code.validate()
|
||||
} catch (e: WordCountException) {
|
||||
|
|
Loading…
Reference in a new issue