Skip to content

Commit

Permalink
No longer cast all tag/blocks to atom
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Arentsen committed Jan 22, 2019
1 parent 6944ef4 commit ea249d9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/liquid/registers.ex
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,13 @@ defmodule Liquid.Registers do
end

def lookup(name) when is_binary(name) do
name |> String.to_atom() |> lookup
try do
name
|> String.to_existing_atom()
|> lookup()
rescue
ArgumentError -> nil
end
end

def lookup(name) when is_atom(name) do
Expand Down

0 comments on commit ea249d9

Please sign in to comment.