From 08aec2c20adae8e6f04cac08566a8decd818e5cd Mon Sep 17 00:00:00 2001 From: yp05327 <576951401@qq.com> Date: Tue, 26 Mar 2024 15:45:11 +0900 Subject: [PATCH] Fix panic for `fixBrokenRepoUnits16961` (#30068) ![image](https://github.com/go-gitea/gitea/assets/18380374/508b3ceb-f53d-4d3b-a781-97c1542af1cb) --- services/doctor/fix16961.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/services/doctor/fix16961.go b/services/doctor/fix16961.go index d3f36d8d5c..50d9ac6621 100644 --- a/services/doctor/fix16961.go +++ b/services/doctor/fix16961.go @@ -216,6 +216,12 @@ func fixBrokenRepoUnit16961(repoUnit *repo_model.RepoUnit, bs []byte) (fixed boo return false, nil } + var cfg any + err = json.UnmarshalHandleDoubleEncode(bs, &cfg) + if err == nil { + return false, nil + } + switch repoUnit.Type { case unit.TypeCode, unit.TypeReleases, unit.TypeWiki, unit.TypeProjects: cfg := &repo_model.UnitConfig{}