]> source.dussan.org Git - gitea.git/commitdiff
Prevent panic when empty MilestoneID in repo/issue/list (#14911)
authorzeripath <art27@cantab.net>
Sun, 7 Mar 2021 02:25:54 +0000 (02:25 +0000)
committerGitHub <noreply@github.com>
Sun, 7 Mar 2021 02:25:54 +0000 (10:25 +0800)
This PR adds a simple check to only test the MilestoneID if it is not empty.

Fix #14906

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
templates/repo/issue/list.tmpl

index 26eb0e27c13497504b58a8b87c1da211b0083bc0..904b4d8bd0866e8a75465fbf8b63fc2c9617bbd4 100644 (file)
@@ -56,7 +56,7 @@
                                                <div class="menu">
                                                        <a class="item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_milestone_no_select"}}</a>
                                                        {{range .Milestones}}
-                                                               <a class="{{if eq $.MilestoneID .ID}}active selected{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{.ID}}&assignee={{$.AssigneeID}}">{{.Name}}</a>
+                                                               <a class="{{if $.MilestoneID}}{{if eq $.MilestoneID .ID}}active selected{{end}}{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{.ID}}&assignee={{$.AssigneeID}}">{{.Name}}</a>
                                                        {{end}}
                                                </div>
                                        </div>