From a701465d899c89495ed880f07062e9a3f0f25be4 Mon Sep 17 00:00:00 2001 From: Jack Wines Date: Fri, 16 Jun 2023 22:01:59 -0700 Subject: [PATCH] whoops, gotta filter empty votes --- src/Main.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Main.hs b/src/Main.hs index 8e5b3a2..d4b41f5 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -74,7 +74,7 @@ results pollId = do noVotesAsBallot notVotedFor' = if S.null notVotedFor' then [] else [notVotedFor'] toNonEmptyList :: [B.Ballot] -> Maybe (LN.NonEmpty (LN.NonEmpty T.Text)) - toNonEmptyList = LN.nonEmpty . My.mapMaybe (LN.nonEmpty . B.options) + toNonEmptyList = LN.nonEmpty . My.mapMaybe (LN.nonEmpty . filter (not . T.null) . B.options) nthPlaceFor :: S.Set T.Text -> L.Html () -> L.Html () nthPlaceFor options place = do