core: allow require module from plugin dir

This commit is contained in:
undefined committed 2023-03-23 20:01:49 +08:00
1 parent f79b8ab0c0
commit 15dba5dd45
4 files changed
+11 -6

No files matched your search

@@ -83,8 +83,8 @@ export default connect(mapStateToProps, mapDispatchToProps)(class ScratchpadTool
super(props);
if (!availableLangs[this.props.editorLang]) {
// preference not allowed
const key = keys.filter((i) => availableLangs[i].pretest)
.find((i) => availableLangs[i].pretest.split('.')[0] === this.props.editorLang.split('.')[0]);
const key = this.props.editorLang ? keys.filter((i) => availableLangs[i].pretest)
.find((i) => availableLangs[i].pretest.split('.')[0] === this.props.editorLang.split('.')[0]) : '';
this.props.setEditorLanguage(key || keys[0]);
}
}