From 4a34a91848403f1cc1b925ccf45ad3766b45b84e Mon Sep 17 00:00:00 2001 From: undefined Date: Sun, 21 Mar 2021 09:19:40 +0800 Subject: [PATCH] judge: also fix for daemon --- packages/hydrojudge/package.json | 2 +- packages/hydrojudge/src/hosts/hydro.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/hydrojudge/package.json b/packages/hydrojudge/package.json index e9a1f5bdd..94bdfd562 100644 --- a/packages/hydrojudge/package.json +++ b/packages/hydrojudge/package.json @@ -1,7 +1,7 @@ { "name": "@hydrooj/hydrojudge", "bin": "bin/hydrojudge.js", - "version": "2.4.14", + "version": "2.4.15", "os": [ "linux" ], diff --git a/packages/hydrojudge/src/hosts/hydro.ts b/packages/hydrojudge/src/hosts/hydro.ts index b4b4075da..3cff1747c 100644 --- a/packages/hydrojudge/src/hosts/hydro.ts +++ b/packages/hydrojudge/src/hosts/hydro.ts @@ -195,7 +195,7 @@ export default class Hydro { async cacheOpen(domainId: string, pid: string, files: any[], next?) { const domainDir = path.join(getConfig('cache_dir'), this.config.host, domainId); const filePath = path.join(domainDir, pid); await fs.ensureDir(filePath); - if (!files.length) throw new SystemError('Problem data not found.'); + if (!files?.length) throw new SystemError('Problem data not found.'); let etags: Record = {}; try { etags = JSON.parse(fs.readFileSync(path.join(filePath, 'etags')).toString());