From d13b67dfad486f3ee7ce14da95db97e5718586c6 Mon Sep 17 00:00:00 2001 From: panda Date: Mon, 21 Oct 2024 00:43:39 +0800 Subject: [PATCH] fps-import: fix testdata import (#892) --- packages/fps-importer/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/fps-importer/index.ts b/packages/fps-importer/index.ts index 4a2386600..85a93924b 100644 --- a/packages/fps-importer/index.ts +++ b/packages/fps-importer/index.ts @@ -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) {