diff options
author | yp05327 <576951401@qq.com> | 2024-03-26 15:45:11 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-26 14:45:11 +0800 |
commit | 08aec2c20adae8e6f04cac08566a8decd818e5cd (patch) | |
tree | 5bbb1a0301bd44d3b43fee2746a5d314b4282d8e /services/doctor | |
parent | bcb151c220c3fa6003810e436acdda9cc0501e58 (diff) | |
download | gitea-08aec2c20adae8e6f04cac08566a8decd818e5cd.tar.gz gitea-08aec2c20adae8e6f04cac08566a8decd818e5cd.zip |
Fix panic for `fixBrokenRepoUnits16961` (#30068)
![image](https://github.com/go-gitea/gitea/assets/18380374/508b3ceb-f53d-4d3b-a781-97c1542af1cb)
Diffstat (limited to 'services/doctor')
-rw-r--r-- | services/doctor/fix16961.go | 6 |
1 files changed, 6 insertions, 0 deletions
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{} |