From 66437f53f1dd8ca3669e8c58a72a85dcfced02e5 Mon Sep 17 00:00:00 2001 From: zouap Date: Thu, 13 Jan 2022 15:56:33 +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 0cdb47dc7..16dcb0d12 100644 --- a/routers/repo/ai_model_manage.go +++ b/routers/repo/ai_model_manage.go @@ -211,6 +211,9 @@ func DeleteModel(ctx *context.Context) { } func isCanDelete(ctx *context.Context, model *models.AiModelManage) bool { + if ctx.User == nil { + return false + } if ctx.User.IsAdmin || ctx.User.ID == model.UserId { return true }