From 62062e5dfb06d74aa2191e22a5a577801355906c Mon Sep 17 00:00:00 2001 From: Valentin Brandl Date: Mon, 29 Jul 2019 22:32:08 +0200 Subject: [PATCH] Don't parse empty strings --- frontend/src/Parse.elm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/src/Parse.elm b/frontend/src/Parse.elm index 83ecf5a..7b4b6d8 100644 --- a/frontend/src/Parse.elm +++ b/frontend/src/Parse.elm @@ -13,7 +13,11 @@ parseUrl url = |> Maybe.andThen splitOffHead |> Maybe.andThen (\( ( ( ( ( prov, user ), repo ), separator ), gitref ), file ) -> - if List.isEmpty file || (separator /= pathSeparator prov) then + if + List.isEmpty file + || (List.head file |> Maybe.map String.isEmpty |> Maybe.withDefault False) + || (separator /= pathSeparator prov) + then Nothing else