Closed asiniy closed 8 years ago
Hmm.. well, is_atom(nil)
is true
, so I wanted to be extra sure. I see that if endpoint
is nil in that function, it will call Phoenix.Router.Helpers.url(nil, nil)
, which results in an error:
iex(1)> Phoenix.Router.Helpers.url(nil, nil)
** (UndefinedFunctionError) function nil.url/0 is undefined or private
nil.url()
I think we can leave it in, and if there's a case where endpoint
is nil, show a more descriptive error message? With the current implementation there is just the match error. What do you think?
@keichan34 kinda unpredictable behaviour of is_atom(true)
here. You're absolutely right here, I'm closing the PR.
By the way, I asked a question at SO: http://stackoverflow.com/questions/38852905/why-is-atomnil-equals-to-true-in-elixir
I think it's not needed here. WDYT?