diff --git a/routers/repo/ai_model_manage.go b/routers/repo/ai_model_manage.go index 22a8ee6c2..6f0d6da3d 100644 --- a/routers/repo/ai_model_manage.go +++ b/routers/repo/ai_model_manage.go @@ -414,6 +414,9 @@ func isQueryRight(ctx *context.Context) bool { } func isOper(ctx *context.Context, modelUserId int64) bool { + if ctx.User == nil { + return false + } if ctx.User.IsAdmin || ctx.Repo.IsAdmin() || ctx.Repo.IsOwner() || ctx.User.ID == modelUserId { return true }