Skip to content

Commit ea40eb7

Browse files
Resolve panic on failed interface conversion in migration v156 (#15604)
go panics otherwise with `panic: interface conversion: error is git.ErrNotExist, not *git.ErrNotExist`, thanks to Codeberg/Andi for reporting this. Co-authored-by: Lunny Xiao <[email protected]>
1 parent 1b3dbdb commit ea40eb7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

models/migrations/v156.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ func fixPublisherIDforTagReleases(x *xorm.Engine) error {
119119
commit, err := gitRepo.GetTagCommit(release.TagName)
120120
if err != nil {
121121
if git.IsErrNotExist(err) {
122-
log.Warn("Unable to find commit %s for Tag: %s in %-v. Cannot update publisher ID.", err.(*git.ErrNotExist).ID, release.TagName, repo)
122+
log.Warn("Unable to find commit %s for Tag: %s in %-v. Cannot update publisher ID.", err.(git.ErrNotExist).ID, release.TagName, repo)
123123
continue
124124
}
125125
log.Error("Error whilst getting commit for Tag: %s in %-v.", release.TagName, repo)

0 commit comments

Comments
 (0)