diff --git a/routers/repo/ai_model_manage.go b/routers/repo/ai_model_manage.go index 4f07996fe..90d537031 100644 --- a/routers/repo/ai_model_manage.go +++ b/routers/repo/ai_model_manage.go @@ -110,6 +110,16 @@ func SaveModel(ctx *context.Context) { label := ctx.Query("Label") description := ctx.Query("Description") + if JobId == "" || VersionName == "" { + ctx.Error(500, fmt.Sprintf("JobId or VersionName is null.")) + return + } + + if name == "" || version == "" { + ctx.Error(500, fmt.Sprintf("name or version is null.")) + return + } + err := saveModelByParameters(JobId, VersionName, name, version, label, description, ctx.User.ID) if err != nil {