mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2024-12-23 00:26:30 +00:00
Dialyzer: fix pattern match coverage
This commit is contained in:
parent
7f649a7a19
commit
88042109a3
1 changed files with 6 additions and 4 deletions
|
@ -8,10 +8,12 @@ defmodule Pleroma.EctoType.ActivityPub.ObjectValidators.BareUri do
|
|||
def type, do: :string
|
||||
|
||||
def cast(uri) when is_binary(uri) do
|
||||
case URI.parse(uri) do
|
||||
%URI{scheme: nil} -> :error
|
||||
%URI{} -> {:ok, uri}
|
||||
_ -> :error
|
||||
parsed = URI.parse(uri)
|
||||
|
||||
if is_nil(parsed.scheme) do
|
||||
:error
|
||||
else
|
||||
{:ok, uri}
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue