fix saving new protected note revisions, closes #2951

This commit is contained in:
zadam
2022-07-01 22:49:10 +02:00
parent dbf1ac1e9d
commit 0d4275a260
6 changed files with 450 additions and 144 deletions

View File

@@ -48,7 +48,7 @@ function decrypt(key, cipherText, ivLength = 13) {
}
catch (e) {
// recovery from https://github.com/zadam/trilium/issues/510
if (e.message && e.message.includes("WRONG_FINAL_BLOCK_LENGTH")) {
if (e.message?.includes("WRONG_FINAL_BLOCK_LENGTH") || e.message?.includes("wrong final block length")) {
log.info("Caught WRONG_FINAL_BLOCK_LENGTH, returning cipherText instead");
return cipherText;