mirror of
https://github.com/hexastack/hexabot
synced 2024-11-23 20:52:23 +00:00
Merge pull request #364 from Hexastack/fix/plugin-settings-null-check
fix: add null checks for plugin and settings to prevent TypeError
This commit is contained in:
commit
6f6e508e41
@ -59,7 +59,7 @@ export class TranslationService extends BaseService<Translation> {
|
|||||||
|
|
||||||
// plugin
|
// plugin
|
||||||
Object.entries(block.message.args).forEach(([l, arg]) => {
|
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 (setting?.translatable) {
|
||||||
if (Array.isArray(arg)) {
|
if (Array.isArray(arg)) {
|
||||||
// array of text
|
// array of text
|
||||||
|
Loading…
Reference in New Issue
Block a user