fps-import: ignore file not exist

This commit is contained in:
undefined committed 2022-11-10 14:27:27 +08:00
1 parent 016c7ea8b7
commit f80c3426fc
2 files changed
+2 -1

No files matched your search

+1
View File
@@ -66,6 +66,7 @@ class FpsProblemImportHandler extends Handler {
ProblemModel.addTestdata(domainId, pid, 'config.yaml', Buffer.from(`time: ${config.time}\nmemory: ${config.memory}`)),
];
const addTestdata = (node: any, id: string, ext: string) => {
if (!node && typeof node !== 'string') return; // Ignore file not exist
let c = node;
if (node.$?.name) {
id = node.$.name;