From 08c0e8b612b52d5bbfee10643c1b7081bf89d132 Mon Sep 17 00:00:00 2001 From: Mohamed Chedli Date: Fri, 22 Nov 2024 18:26:36 +0100 Subject: [PATCH] fix: add null checks for plugin and settings to prevent TypeError --- api/src/i18n/services/translation.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/src/i18n/services/translation.service.ts b/api/src/i18n/services/translation.service.ts index 434d062..a577079 100644 --- a/api/src/i18n/services/translation.service.ts +++ b/api/src/i18n/services/translation.service.ts @@ -59,7 +59,7 @@ export class TranslationService extends BaseService { // plugin Object.entries(block.message.args).forEach(([l, arg]) => { - const setting = plugin.settings.find(({ label }) => label === l); + const setting = plugin?.settings.find(({ label }) => label === l); if (setting?.translatable) { if (Array.isArray(arg)) { // array of text