Merge pull request #364 from Hexastack/fix/plugin-settings-null-check
Some checks failed
Build and Push Docker Images / build-and-push (push) Blocked by required conditions
Build and Push Docker Images / paths-filter (push) Failing after 12m49s

fix: add null checks for plugin and settings to prevent TypeError
This commit is contained in:
Med Marrouchi 2024-11-22 18:40:47 +01:00 committed by GitHub
commit 6f6e508e41
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -59,7 +59,7 @@ export class TranslationService extends BaseService<Translation> {
// 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