From 6d47b63be25dd23d81c8286ac993281c8099e963 Mon Sep 17 00:00:00 2001 From: yp05327 <576951401@qq.com> Date: Tue, 26 Mar 2024 19:20:03 +0900 Subject: [PATCH] Fix panic for fixBrokenRepoUnits16961 (#30068) (#30100) backport #30068 --- modules/doctor/fix16961.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/doctor/fix16961.go b/modules/doctor/fix16961.go index 562c78dd76..3b1f34c907 100644 --- a/modules/doctor/fix16961.go +++ b/modules/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{}