fps-import: fix testdata import (#892)

This commit is contained in:
panda authored and GitHub committed 2024-10-21 00:43:39 +08:00
1 parent affdadf3d2
commit d13b67dfad
1 file changed
+1 -1
+1 -1
View File
@@ -47,7 +47,7 @@ class FpsProblemImportHandler extends Handler {
// `filename` attribute introduced by winterant/OnlineJudge
// PLEASE, respect the spec
const filename = node.$?.filename || `${id}.${ext}`;
const c = node._ || node;
const c = node._ || (typeof node === 'string' ? node : '');
tasks.push(ProblemModel.addTestdata(domainId, pid, filename, Buffer.from(c)));
};
if (p.test_output) {