From 36d46003d640010bd8a8ad2cd849dd5feb4a82e0 Mon Sep 17 00:00:00 2001 From: Hsiaoyi <1210282+xream@users.noreply.github.com> Date: Mon, 31 Jul 2023 17:42:31 +0800 Subject: [PATCH] Fixed: empty uploading files --- backend/src/utils/gist.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/backend/src/utils/gist.js b/backend/src/utils/gist.js index 476e1c0..8504e78 100644 --- a/backend/src/utils/gist.js +++ b/backend/src/utils/gist.js @@ -40,6 +40,10 @@ export default class Gist { } async upload(files) { + if (Object.keys(files).length === 0) { + return Promise.reject('未提供需上传的文件'); + } + const id = await this.locate(); if (id === -1) {