Fix empty recovery password error

This commit is contained in:
Andrew 2024-06-28 18:33:07 +09:30
parent eb63af2f8d
commit 8cc7e65abf

View File

@ -83,8 +83,8 @@ class MnemonicCodec(private val loadFileContents: (String) -> String) {
val prefixLength = languageConfiguration.prefixLength
val n = truncatedWordSet.size.toLong()
if (mnemonic.isEmpty()) throw IllegalArgumentException()
if (words.isEmpty()) throw IllegalArgumentException()
if (mnemonic.isEmpty()) throw DecodingError.InputTooShort
if (words.isEmpty()) throw DecodingError.InputTooShort
fun String.prefix() = substring(0 until prefixLength)