diff options
Diffstat (limited to 'modules/templates')
-rw-r--r-- | modules/templates/helper.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/templates/helper.go b/modules/templates/helper.go index 4e767ad44d..987a6ad983 100644 --- a/modules/templates/helper.go +++ b/modules/templates/helper.go @@ -371,6 +371,10 @@ func NewFuncMap() []template.FuncMap { "RenderLabels": func(labels []*models.Label) template.HTML { html := `<span class="labels-list">` for _, label := range labels { + // Protect against nil value in labels - shouldn't happen but would cause a panic if so + if label == nil { + continue + } html += fmt.Sprintf("<div class='ui label' style='color: %s; background-color: %s'>%s</div> ", label.ForegroundColor(), label.Color, RenderEmoji(label.Name)) } |