Don't parse empty strings

This commit is contained in:
Valentin Brandl 2019-07-29 22:32:08 +02:00
parent 45247dfa3f
commit 62062e5dfb
No known key found for this signature in database
GPG Key ID: 30D341DD34118D7D

View File

@ -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