Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API: Search Issues, dont show 500 if filter result in empty list #19244

Merged
merged 8 commits into from
Apr 8, 2022
2 changes: 1 addition & 1 deletion models/issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -1543,7 +1543,7 @@ func CountIssues(opts *IssuesOptions) (int64, error) {
return 0, fmt.Errorf("Find: %v", err)
}
if len(countsSlice) < 1 {
6543 marked this conversation as resolved.
Show resolved Hide resolved
6543 marked this conversation as resolved.
Show resolved Hide resolved
return 0, fmt.Errorf("there is less than one result sql record")
return 0, nil
}
return countsSlice[0].Count, nil
}
Expand Down