From 33d4ed973f7c5d9883b6b75daf200bfb8a947500 Mon Sep 17 00:00:00 2001 From: silverwind Date: Fri, 26 Apr 2024 13:29:05 +0200 Subject: [PATCH] simplify --- routers/web/repo/editor.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/routers/web/repo/editor.go b/routers/web/repo/editor.go index d9baefe7c1..474d7503e4 100644 --- a/routers/web/repo/editor.go +++ b/routers/web/repo/editor.go @@ -419,9 +419,7 @@ func DiffPreviewPost(ctx *context.Context) { return } - if diff.NumFiles == 0 { - ctx.Data["File"] = nil - } else { + if diff.NumFiles != 0 { ctx.Data["File"] = diff.Files[0] }