Skip to content

Commit 0f22161

Browse files
Handle error
1 parent 8ec7400 commit 0f22161

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

routers/repo/issue.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -606,13 +606,17 @@ func commentTag(repo *models.Repository, poster *models.User, issue *models.Issu
606606

607607
// ViewIssue render issue view page
608608
func ViewIssue(ctx *context.Context) {
609-
if extIssueUnit, _ := ctx.Repo.Repository.GetUnit(models.UnitTypeExternalTracker); extIssueUnit != nil {
609+
extIssueUnit, err := ctx.Repo.Repository.GetUnit(models.UnitTypeExternalTracker)
610+
if err == nil && extIssueUnit != nil {
610611
if extIssueUnit.ExternalTrackerConfig().ExternalTrackerStyle == markup.IssueNameStyleNumeric {
611612
metas := ctx.Repo.Repository.ComposeMetas()
612613
metas["index"] = ctx.Params(":index")
613614
ctx.Redirect(com.Expand(extIssueUnit.ExternalTrackerConfig().ExternalTrackerFormat, metas))
614615
return
615616
}
617+
} else if err != nil && !models.IsErrUnitTypeNotExist(err) {
618+
ctx.ServerError("GetUnit", err)
619+
return
616620
}
617621

618622
issue, err := models.GetIssueByIndex(ctx.Repo.Repository.ID, ctx.ParamsInt64(":index"))

0 commit comments

Comments
 (0)