From 8cc7e65abf543d726dd422b6849a2b5ba4ee5a85 Mon Sep 17 00:00:00 2001 From: Andrew Date: Fri, 28 Jun 2024 18:33:07 +0930 Subject: [PATCH] Fix empty recovery password error --- .../main/java/org/session/libsignal/crypto/MnemonicCodec.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libsignal/src/main/java/org/session/libsignal/crypto/MnemonicCodec.kt b/libsignal/src/main/java/org/session/libsignal/crypto/MnemonicCodec.kt index 12cb092b00..b0d3966905 100644 --- a/libsignal/src/main/java/org/session/libsignal/crypto/MnemonicCodec.kt +++ b/libsignal/src/main/java/org/session/libsignal/crypto/MnemonicCodec.kt @@ -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)