mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 17:36:08 +08:00
core: add lang existance check
This commit is contained in:
1 parent
29dd5645c1
commit
25741ac300
1 file changed
+1
-1
@@ -506,7 +506,7 @@ export class ProblemSubmitHandler extends ProblemDetailHandler {
|
||||
if (typeof config === 'string' || config === null) throw new ProblemConfigError();
|
||||
if (config.type === 'objective') {
|
||||
lang = '_';
|
||||
} else if ((config.langs && !config.langs.includes(lang)) || setting.langs[lang].disabled) {
|
||||
} else if ((config.langs && !config.langs.includes(lang)) || !setting.langs[lang] || setting.langs[lang].disabled) {
|
||||
throw new ProblemNotAllowLanguageError();
|
||||
}
|
||||
if (pretest) {
|
||||
|
||||
Reference in new issue
Block a user