Browse Source

add more function for find_value

dcy 10 years ago
parent
commit
c79fbc3fad
1 changed files with 2 additions and 0 deletions
  1. 2 0
      src/erlydtl_runtime.erl

+ 2 - 0
src/erlydtl_runtime.erl

@@ -72,6 +72,8 @@ find_value(Key, L) when is_integer(Key), is_list(L) ->
     if Key =< length(L) -> lists:nth(Key, L);
        true -> undefined
     end;
+find_value(Key, L) when is_atom(Key), is_binary(L) ->
+    undefined;
 find_value(Key, {GBSize, GBData}) when is_integer(GBSize) ->
     case gb_trees:lookup(Key, {GBSize, GBData}) of
         {value, Val} ->