fix(api): do not try to transform empty values passed to user notificationTypes

fixes #1501
This commit is contained in:
sct
2021-04-26 08:22:50 +09:00
parent 48587719e9
commit ef3f9778aa

View File

@@ -86,7 +86,11 @@ export class UserSettings {
return values;
},
to: (value: Partial<NotificationAgentTypes>): string => {
to: (value: Partial<NotificationAgentTypes>): string | null => {
if (!value || typeof value !== 'object') {
return null;
}
const allowedKeys = Object.values(NotificationAgentKey);
// Remove any unknown notification agent keys before saving to db