From 129f249ca293d2eff63808db82b0a9fefdd0851a Mon Sep 17 00:00:00 2001 From: Correl Roush Date: Sat, 30 May 2020 14:08:21 -0400 Subject: [PATCH] Allow for null names in presence events Leave events may leave the presence metadata fields null, including name. Fall back on an empty string if that is the case. --- assets/src/PlanningPokerRoom.elm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/assets/src/PlanningPokerRoom.elm b/assets/src/PlanningPokerRoom.elm index 3b078bc..7479a82 100644 --- a/assets/src/PlanningPokerRoom.elm +++ b/assets/src/PlanningPokerRoom.elm @@ -514,7 +514,11 @@ playersDecoder = let presence = Decode.map2 (Player Participant) - (Decode.field "name" Decode.string) + (Decode.field "name" + (Decode.nullable Decode.string + |> Decode.map (Maybe.withDefault "") + ) + ) (Decode.field "vote" (Decode.nullable Decode.string)) in Decode.dict presence