1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-15 23:00:36 +02:00

All: Fixes #2591: Handle invalid UTF-8 data when encrypting

This commit is contained in:
Laurent Cozic
2020-03-06 19:11:51 +00:00
parent 40eba9e95e
commit c6c4e950db
3 changed files with 62 additions and 12 deletions

View File

@ -348,7 +348,9 @@ class BaseItem extends BaseModel {
} catch (error) {
const msg = [`Could not encrypt item ${item.id}`];
if (error && error.message) msg.push(error.message);
throw new Error(msg.join(': '));
const newError = new Error(msg.join(': '));
newError.stack = error.stack;
throw newError;
}
// List of keys that won't be encrypted - mostly foreign keys required to link items