getCipherForDiff catch missing fields in encrypted_pcd

This commit is contained in:
NicolasCantu 2025-02-10 17:59:40 +01:00
parent cc2f960af0
commit 51664e62ec

View File

@ -524,20 +524,20 @@ export default class Services {
// get the process
try {
const process = await this.getProcess(diff.process_id);
const state = process.states.find(state => state.state_id === diff.state_id);
if (state) {
// Now we return the encrypted value for that field
const cipher = state.encrypted_pcd[diff.field];
if (cipher) {
return cipher;
} else {
console.error('Failed to get encrypted value');
}
}
} catch (e) {
console.error('Failed to get process:', e);
return null;
}
const state = process.states.find(state => state.state_id === diff.state_id);
if (state) {
// Now we return the encrypted value for that field
const cipher = state.encrypted_pcd[diff.field];
if (cipher) {
return cipher;
} else {
console.error('Failed to get encrypted value');
}
}
return null;
}