Add null-check to further improve errorchecking for missing compromisedfield for pre 2.3.0 shares

Signed-off-by: fnuesse <felix.nuesse@t-online.de>
This commit is contained in:
fnuesse 2019-05-15 15:29:06 +02:00
parent b5257eecd0
commit 1d0fdfd957
No known key found for this signature in database
GPG key ID: 2089A3431243E819

View file

@ -191,7 +191,7 @@
try {
field_decrypted_value = EncryptService.decryptString(fieldValue, sharedKey);
} catch (e) {
if(field === 'compromised'){
if(field === 'compromised' && fieldValue === null){
//old shares do not have compromised set, so we need to make sure that it will be set for version 2.3.0
//credentials from 2.3.0 onwards have compromised already set, and don't need to worry about that.
//if compromised is not the issue, break and throw an error