diff --git a/source/addons/compatibility.ts b/source/addons/compatibility.ts index b6a595b..af4416e 100644 --- a/source/addons/compatibility.ts +++ b/source/addons/compatibility.ts @@ -34,27 +34,27 @@ export default class CompatibilityModule { private async convert(data: any, version: string): Promise { const settingsMap: { [key: string]: any } = { '1.*': { - extensions: data.extensions.replace(',', '>'), - forced_extensions: data.force_extensions.replace(',', '>'), + extensions: data.extensions?.replace(',', '>') ?? '', + forced_extensions: data.forced_extensions?.replace(',', '>') ?? '', is_onload: Boolean(data.is_dynamic_on), }, '2.0': { - extensions: data.extensions.replace(',', '>'), - grouped_extensions: data.grouped_extensions.replace(',', '>'), + extensions: data.extensions?.replace(',', '>') ?? '', + grouped_extensions: data.grouped_extensions?.replace(',', '>') ?? '', }, '2.1': { - grouped_extensions: data.grouped_extensions.replace(',', '>'), - extensions: data.extensions.replace(';', '>'), - forced_extensions: data.forced_extensions.replace(';', '>'), - ignore_extensions: data.ignore_extensions.replace(';', '>'), - ignore_masks: data.ignore_masks.replace(';', '>'), + grouped_extensions: data.grouped_extensions?.replace(';', '>') ?? '', + extensions: data.extensions?.replace(';', '>') ?? '', + forced_extensions: data.forced_extensions?.replace(';', '>') ?? '', + ignore_extensions: data.ignore_extensions?.replace(';', '>') ?? '', + ignore_masks: data.ignore_masks?.replace(';', '>') ?? '', }, '2.4': { - grouped_extensions: data.grouped_extensions.replace(',', '>'), - extensions: data.extensions.replace(';', '>'), - forced_extensions: data.forced_extensions.replace(';', '>'), - ignore_extensions: data.ignore_extensions.replace(';', '>'), - ignore_masks: data.ignore_masks.replace(';', '>'), + grouped_extensions: data.grouped_extensions?.replace(',', '>') ?? '', + extensions: data.extensions?.replace(';', '>') ?? '', + forced_extensions: data.forced_extensions?.replace(';', '>') ?? '', + ignore_extensions: data.ignore_extensions?.replace(';', '>') ?? '', + ignore_masks: data.ignore_masks?.replace(';', '>') ?? '', }, };