From 6f08cff4ca9024630144938a0a954ac0a1723917 Mon Sep 17 00:00:00 2001 From: yuyuanshifu <747342561@qq.com> Date: Mon, 2 Nov 2020 17:20:29 +0800 Subject: [PATCH] fix bug --- routers/repo/attachment.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/routers/repo/attachment.go b/routers/repo/attachment.go index e2b6f4d2b..c2bbc5d46 100755 --- a/routers/repo/attachment.go +++ b/routers/repo/attachment.go @@ -398,6 +398,20 @@ func GetSuccessChunks(ctx *context.Context) { attachID = attach.ID } + if attach == nil { + ctx.JSON(200, map[string]string{ + "uuid": fileChunk.UUID, + "uploaded": strconv.Itoa(fileChunk.IsUploaded), + "uploadID": fileChunk.UploadID, + "chunks": string(chunks), + "attachID": "0", + "datasetID": "0", + "fileName": "", + "datasetName": "", + }) + return + } + dataset, err := models.GetDatasetByID(attach.DatasetID) if err != nil { ctx.ServerError("GetDatasetByID", err)