fix error when saving unprotected notes

This commit is contained in:
azivner
2017-11-17 18:56:52 -05:00
parent a6bf04f8d4
commit c4a9aaa52d
3 changed files with 12 additions and 3 deletions

View File

@@ -17,9 +17,18 @@ module.exports = function(req) {
return protected_session.getDataKey(req);
}
function getDataKeyOrNull() {
if (!isProtectedSessionAvailable()) {
return null;
}
return protected_session.getDataKey(req);
}
return {
browserId,
isProtectedSessionAvailable,
getDataKey
getDataKey,
getDataKeyOrNull
};
};