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)