Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion server/rest.go
Original file line number Diff line number Diff line change
Expand Up @@ -1872,7 +1872,7 @@ func (s *RestServer) getTypedUserItemFeedback(request *restful.Request, response
itemId := request.PathParameter("item-id")
if feedback, err := s.DataClient.GetUserItemFeedback(ctx, userId, itemId, feedbackType); err != nil {
InternalServerError(response, err)
} else if feedbackType == "" {
} else if feedbackType == "" || len(feedback) == 0 {
Text(response, "{}")
} else {
Ok(response, feedback[0])
Expand Down
4 changes: 4 additions & 0 deletions storage/cache/redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,9 @@ func decodeCategory(s string) (string, error) {
if err != nil {
return "", errors.Trace(err)
}
if len(b) == 0 {
return "", nil
}
return string(b[1:]), nil
}

Expand All @@ -496,6 +499,7 @@ func decodeCategories(s string) ([]string, error) {
if err != nil {
return nil, errors.Trace(err)
}
// category = "" is also a valid category
categories = append(categories, category)
}
return categories, nil
Expand Down
Loading