judge: bug fix

This commit is contained in:
undefined committed 2022-12-05 13:04:15 +08:00
1 parent bba42d5936
commit d29bd22249
3 files changed
+6 -8

No files matched your search

+1 -1
View File
@@ -145,7 +145,7 @@ export default class Hydro {
send(rid: string | ObjectID, key: 'next' | 'end', data: Partial<JudgeResultBody>) {
data.rid = new ObjectID(rid);
data.key = key;
if (data.case) data.case.message = removeNixPath(data.case.message || '');
if (data.case && typeof data.case.message === 'string') data.case.message = removeNixPath(data.case.message);
if (typeof data.message === 'string') data.message = removeNixPath(data.message);
if (typeof data.compilerText === 'string') data.compilerText = removeNixPath(data.compilerText);
this.ws.send(JSON.stringify(data));