aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Magorsch <arzano@gentoo.org>2020-09-09 09:17:12 +0200
committerMax Magorsch <arzano@gentoo.org>2020-09-09 09:17:12 +0200
commitcdaad3495be707a27b1b91609702c04d6fbdd531 (patch)
treeb8cde00c1e83a5c1dcdc172385482eabf784b331
parentSort commits in the maintainers changelog (diff)
downloadsoko-cdaad3495be707a27b1b91609702c04d6fbdd531.tar.gz
soko-cdaad3495be707a27b1b91609702c04d6fbdd531.tar.bz2
soko-cdaad3495be707a27b1b91609702c04d6fbdd531.zip
Handle empty restricts correctly
Signed-off-by: Max Magorsch <arzano@gentoo.org>
-rw-r--r--pkg/app/handler/packages/utils.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/pkg/app/handler/packages/utils.go b/pkg/app/handler/packages/utils.go
index 183a9d5..d4f8752 100644
--- a/pkg/app/handler/packages/utils.go
+++ b/pkg/app/handler/packages/utils.go
@@ -346,7 +346,7 @@ func CreateFeedData(name string, versions []*models.Version) interface{} {
func FormatRestricts(restricts []string) string {
var result []string
for _, restrict := range restricts {
- if restrict != "(" && restrict != ")" && !strings.HasSuffix(restrict, "?") {
+ if restrict != "" && restrict != "(" && restrict != ")" && !strings.HasSuffix(restrict, "?") {
result = append(result, strings.ToUpper(string(restrict[0])))
}
}