]> source.dussan.org Git - gitea.git/commit
Prevent adding nil label to .AddedLabels or .RemovedLabels (#14623)
authorzeripath <art27@cantab.net>
Wed, 10 Feb 2021 02:50:44 +0000 (02:50 +0000)
committerGitHub <noreply@github.com>
Wed, 10 Feb 2021 02:50:44 +0000 (10:50 +0800)
commitf82b1dd7c384e0295530f2ded53c0938f7b2fc9b
tree60308c77693db06d01cdb5915e3264625752fa60
parent30f7ddb833adfe276a93c1a79e243b8d33bdd41e
Prevent adding nil label to .AddedLabels or .RemovedLabels (#14623)

* Prevent adding nil label to .AddedLabels or .RemovedLabels

There are possibly a few old databases out there with malmigrated data that can
cause panics with empty labels being migrated.

This PR adds a few tests to prevent nil labels being added.

Fix #14466

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Add doctor command to remove the broken label comments

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
models/consistency.go
modules/doctor/dbconsistency.go
modules/templates/helper.go
routers/repo/issue.go