mirror of
https://github.com/hexastack/hexabot
synced 2024-11-24 04:53:41 +00:00
fix: add null checks for plugin and settings to prevent TypeError
This commit is contained in:
parent
485744e1e5
commit
08c0e8b612
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user