From 0ae8126da636eb77ebbc200094abef88eb0be101 Mon Sep 17 00:00:00 2001 From: undefined Date: Sat, 16 Jan 2021 12:46:28 +0800 Subject: [PATCH] judge: fix initial run --- packages/hydrojudge/package.json | 2 +- packages/hydrojudge/src/judge/run.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/hydrojudge/package.json b/packages/hydrojudge/package.json index ff7022735..28cdc6d4d 100644 --- a/packages/hydrojudge/package.json +++ b/packages/hydrojudge/package.json @@ -1,7 +1,7 @@ { "name": "@hydrooj/hydrojudge", "bin": "bin/hydrojudge.js", - "version": "2.2.2", + "version": "2.2.3", "main": "package.json", "author": "undefined ", "repository": "https://github.com/hydro-dev/Hydro.git", diff --git a/packages/hydrojudge/src/judge/run.ts b/packages/hydrojudge/src/judge/run.ts index 05ecf9b4e..6352ba3e7 100644 --- a/packages/hydrojudge/src/judge/run.ts +++ b/packages/hydrojudge/src/judge/run.ts @@ -58,7 +58,7 @@ export const judge = async (ctx) => { if (filename) copyIn[`${filename}.in`] = { content: ctx.config.input }; const copyOut = filename ? [`${filename}.out`] : []; const stdin = path.resolve(ctx.tmpdir, '0.in'); - await fs.writeFile(stdin, ctx.config.input); + await fs.writeFile(stdin, ctx.config.input || ''); const stdout = path.resolve(ctx.tmpdir, '0.out'); const stderr = path.resolve(ctx.tmpdir, '0.err'); const res = await run(