Skip to content
Merged
Changes from 1 commit
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
8 changes: 8 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,14 @@ func main() {
return
}
}

// Make sure vote is not empty
if len(vote.Options) == 0 {
c.JSON(http.StatusBadRequest, gin.H{"error": "You did not rank any options"})
return
}

// Submit Vote
database.CastRankedVote(c, &vote, &voter)
} else {
c.JSON(http.StatusInternalServerError, gin.H{"error": "Unknown Poll Type"})
Expand Down
Loading