diff --git a/server/entity/UserSettings.ts b/server/entity/UserSettings.ts index e710b0a29..9b602a5be 100644 --- a/server/entity/UserSettings.ts +++ b/server/entity/UserSettings.ts @@ -86,7 +86,11 @@ export class UserSettings { return values; }, - to: (value: Partial): string => { + to: (value: Partial): string | null => { + if (!value || typeof value !== 'object') { + return null; + } + const allowedKeys = Object.values(NotificationAgentKey); // Remove any unknown notification agent keys before saving to db