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) {