From 6ed05c144f9eb585c8654cf39c1f8c0935612457 Mon Sep 17 00:00:00 2001 From: zouap Date: Mon, 6 Dec 2021 15:58:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- routers/repo/ai_model_manage.go | 3 +++ 1 file changed, 3 insertions(+) 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 }