From 124a9957d086a054f45ca79ea5c5b6b6461a7f56 Mon Sep 17 00:00:00 2001 From: Giteabot Date: Tue, 14 Nov 2023 21:49:12 +0800 Subject: [PATCH] Fix viewing wiki commit on empty repo (#28040) (#28044) Backport #28040 by @JakobDev Fixes https://codeberg.org/forgejo/forgejo/issues/1758 For some weird reason we need to cast this nil. Co-authored-by: JakobDev --- routers/web/repo/middlewares.go | 1 - 1 file changed, 1 deletion(-) diff --git a/routers/web/repo/middlewares.go b/routers/web/repo/middlewares.go index b50e96be3..5f4a219aa 100644 --- a/routers/web/repo/middlewares.go +++ b/routers/web/repo/middlewares.go @@ -16,7 +16,6 @@ import ( // SetEditorconfigIfExists set editor config as render variable func SetEditorconfigIfExists(ctx *context.Context) { if ctx.Repo.Repository.IsEmpty { - ctx.Data["Editorconfig"] = nil return }