Skip to content

Commit

Permalink
Resolve panic on failed interface conversion in migration v156 (#15604)
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
techknowlogick and lunny authored Apr 24, 2021
1 parent 1b3dbdb commit ea40eb7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion models/migrations/v156.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ func fixPublisherIDforTagReleases(x *xorm.Engine) error {
commit, err := gitRepo.GetTagCommit(release.TagName)
if err != nil {
if git.IsErrNotExist(err) {
log.Warn("Unable to find commit %s for Tag: %s in %-v. Cannot update publisher ID.", err.(*git.ErrNotExist).ID, release.TagName, repo)
log.Warn("Unable to find commit %s for Tag: %s in %-v. Cannot update publisher ID.", err.(git.ErrNotExist).ID, release.TagName, repo)
continue
}
log.Error("Error whilst getting commit for Tag: %s in %-v.", release.TagName, repo)
Expand Down

0 comments on commit ea40eb7

Please sign in to comment.