diff --git a/src/main/java/com/sparrowwallet/sparrow/io/Samourai.java b/src/main/java/com/sparrowwallet/sparrow/io/Samourai.java index 6c1ad73e..6459c09d 100644 --- a/src/main/java/com/sparrowwallet/sparrow/io/Samourai.java +++ b/src/main/java/com/sparrowwallet/sparrow/io/Samourai.java @@ -3,6 +3,7 @@ import com.google.common.io.CharStreams; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonParseException; import com.google.gson.reflect.TypeToken; import com.sparrowwallet.drongo.Utils; import com.sparrowwallet.drongo.crypto.SamouraiUtil; @@ -57,6 +58,8 @@ public Keystore getKeystore(ScriptType scriptType, InputStream inputStream, Stri Keystore keystore = Keystore.fromSeed(seed, scriptType.getDefaultDerivation()); keystore.setLabel(getWalletModel().toDisplayString()); return keystore; + } catch(JsonParseException e) { + throw new ImportException("Failed to decrypt the wallet backup file, check if the password is correct."); } catch(ImportException e) { throw e; } catch(Exception e) {