From 571f8127710622911fe8f3b0d639769edc667737 Mon Sep 17 00:00:00 2001 From: Denis Date: Sat, 3 Dec 2022 08:28:43 +0500 Subject: [PATCH] fix: getEncryptedColumn for empty token (#4507) --- server/models/decorators/Encrypted.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server/models/decorators/Encrypted.ts b/server/models/decorators/Encrypted.ts index bc2b0da18..3318d7b46 100644 --- a/server/models/decorators/Encrypted.ts +++ b/server/models/decorators/Encrypted.ts @@ -17,6 +17,9 @@ export default function Encrypted(target: any, propertyKey: string) { * Get the value of an encrypted column given the target and the property key. */ export function getEncryptedColumn(target: any, propertyKey: string): string { + if (!target.getDataValue(propertyKey)) { + return ""; + } try { return Reflect.getMetadata(key, target, propertyKey).get.call(target); } catch (err) {