From 7f91e92d8fb6dc306104c1bf9198a5dfe191a097 Mon Sep 17 00:00:00 2001 From: Rok Garbas Date: Mon, 7 Sep 2020 18:36:24 +0200 Subject: [PATCH] maintainer.name field can also be null (#182) fixes #181 --- src/Page/Packages.elm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Page/Packages.elm b/src/Page/Packages.elm index dbae19f..247d096 100644 --- a/src/Page/Packages.elm +++ b/src/Page/Packages.elm @@ -77,7 +77,7 @@ type alias ResultPackageLicense = type alias ResultPackageMaintainer = - { name : String + { name : Maybe String , email : String , github : Maybe String } @@ -342,7 +342,7 @@ viewResultItemDetails channel item = Nothing -> "#" ] - [ text <| maintainer.name ++ " <" ++ maintainer.email ++ ">" ] + [ text <| Maybe.withDefault "" maintainer.name ++ " <" ++ maintainer.email ++ ">" ] asPre value = pre [] [ text value ] @@ -460,7 +460,7 @@ decodeResultPackageLicense = decodeResultPackageMaintainer : Json.Decode.Decoder ResultPackageMaintainer decodeResultPackageMaintainer = Json.Decode.map3 ResultPackageMaintainer - (Json.Decode.field "name" Json.Decode.string) + (Json.Decode.field "name" (Json.Decode.nullable Json.Decode.string)) (Json.Decode.field "email" Json.Decode.string) (Json.Decode.field "github" (Json.Decode.nullable Json.Decode.string))