diff --git a/routers/repo/attachment.go b/routers/repo/attachment.go index 2def9ffc4..f474f88d6 100755 --- a/routers/repo/attachment.go +++ b/routers/repo/attachment.go @@ -659,6 +659,16 @@ func QueryPrivateDataset(ctx *context.Context){ func queryDatasets(ctx *context.Context, attachs []*models.AttachmentUsername) { var datasets []CloudBrainDataset + if len(attachs) == 0 { + log.Info("dataset is null") + ctx.JSON(200, map[string]string{ + "result_code": "0", + "error_msg": "", + "data": "", + }) + return + } + for _, attch := range attachs { has,err := storage.Attachments.HasObject(models.AttachmentRelativePath(attch.UUID)) if err != nil || !has { diff --git a/routers/repo/cloudbrain.go b/routers/repo/cloudbrain.go index 81554b9fc..6742864c6 100755 --- a/routers/repo/cloudbrain.go +++ b/routers/repo/cloudbrain.go @@ -264,12 +264,11 @@ func downloadCode(repo *models.Repository, codePath string) error { command := "git clone " + repo.CloneLink().HTTPS + " " + codePath cmd := exec.Command("/bin/bash", "-c", command) output, err := cmd.Output() + log.Info(string(output)) if err != nil { - log.Error("exec.Command failed:%v", err) + log.Error("exec.Command(%s) failed:%v", command, err) return err } - log.Info(string(output)) - return nil }