mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 17:36:08 +08:00
core: type check before adding langs data
This commit is contained in:
1 parent
8d5ec0ab03
commit
17cab51f5f
2 files changed
+4
-4
No files matched your search
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "hydrooj",
|
||||
"version": "3.3.17",
|
||||
"version": "3.3.18",
|
||||
"bin": "bin/hydrooj.js",
|
||||
"main": "src/loader",
|
||||
"module": "src/loader",
|
||||
|
||||
@@ -306,9 +306,9 @@ export class ProblemDetailHandler extends ProblemHandler {
|
||||
if (!ddoc || !pdoc) throw new ProblemNotFoundError(this.pdoc.reference.domainId, this.pdoc.reference.pid);
|
||||
this.pdoc.config = pdoc.config;
|
||||
}
|
||||
if (ddoc.langs) {
|
||||
(this.pdoc.config as ProblemConfig).langs = intersection(
|
||||
(this.pdoc.config as ProblemConfig).langs || ddoc.langs.split(','),
|
||||
if (ddoc.langs && typeof this.pdoc.config !== 'string') {
|
||||
this.pdoc.config.langs = intersection(
|
||||
this.pdoc.config.langs || ddoc.langs.split(','),
|
||||
ddoc.langs.split(','),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user