diff --git a/api/src/core/utils/files/config-file-normalizer.ts b/api/src/core/utils/files/config-file-normalizer.ts index d2473d9db..d9fe16ffa 100644 --- a/api/src/core/utils/files/config-file-normalizer.ts +++ b/api/src/core/utils/files/config-file-normalizer.ts @@ -38,14 +38,14 @@ export const getWriteableConfig = ( ...(api.extraOrigins ? { extraOrigins: api.extraOrigins } : {}), }, local: { - ...(local['2Fa'] === 'yes' ? { '2Fa': local['2Fa'] } : {}), - ...(local.showT2Fa === 'yes' ? { showT2Fa: local.showT2Fa } : {}), + ...(local?.['2Fa'] === 'yes' ? { '2Fa': local['2Fa'] } : {}), + ...(local?.showT2Fa === 'yes' ? { showT2Fa: local.showT2Fa } : {}), }, notifier: { apikey: notifier.apikey ?? initialState.notifier.apikey, }, remote: { - ...(remote['2Fa'] === 'yes' ? { '2Fa': remote['2Fa'] } : {}), + ...(remote?.['2Fa'] === 'yes' ? { '2Fa': remote['2Fa'] } : {}), wanaccess: remote.wanaccess ?? initialState.remote.wanaccess, wanport: remote.wanport ?? initialState.remote.wanport, ...(remote.upnpEnabled ? { upnpEnabled: remote.upnpEnabled } : {}),