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;
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@hydrooj/fps-importer",
"version": "1.5.0",
"version": "1.5.1",
"description": "Import FPS problems",
"main": "index.ts",
"repository": "https://github.com/hydro-dev/Hydro.git",