test former key exists
MODIFY
src/storage/mongodb/SettingStorage.ts
src/storage/mongodb/SettingStorage.ts
@@ -325,11 +325,11 @@ export default class SettingStorage {
Constants.DB_PARAMS_MAX_LIMIT);
if (settings.count > 0) {
const cryptoSetting = {
- formerKey: settings.result[0].content.crypto.formerKey,
+ formerKey: settings.result[0].content.crypto.formerKey && settings.result[0].content.crypto.formerKey,
formerKeyProperties: {
- blockCypher: settings.result[0].content.crypto.formerKeyProperties?.blockCypher,
- blockSize: settings.result[0].content.crypto.formerKeyProperties?.blockSize,
- operationMode: settings.result[0].content.crypto.formerKeyProperties?.operationMode,
+ blockCypher: settings.result[0].content.crypto.formerKeyProperties && settings.result[0].content.crypto.formerKeyProperties?.blockCypher,
+ blockSize: settings.result[0].content.crypto.formerKeyProperties && settings.result[0].content.crypto.formerKeyProperties?.blockSize,
+ operationMode: settings.result[0].content.crypto.formerKeyProperties && settings.result[0].content.crypto.formerKeyProperties?.operationMode,
},
key: settings.result[0].content.crypto.key,
keyProperties: {

test former key exists