From 7133e60267beea701b99ab0a870a851fe3cb43dd Mon Sep 17 00:00:00 2001 From: zadam Date: Mon, 21 Dec 2020 22:08:55 +0100 Subject: [PATCH] make encryption more robust in face of null values, #1483 --- src/services/protected_session.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/services/protected_session.js b/src/services/protected_session.js index ebf4b998f..f224ed6f1 100644 --- a/src/services/protected_session.js +++ b/src/services/protected_session.js @@ -43,10 +43,18 @@ function decryptNotes(notes) { } function encrypt(plainText) { + if (plainText === null) { + return null; + } + return dataEncryptionService.encrypt(getDataKey(), plainText); } function decrypt(cipherText) { + if (cipherText === null) { + return null; + } + return dataEncryptionService.decrypt(getDataKey(), cipherText); }