Просмотр исходного кода

Make sure that when checking if a function is exported that the module in question is loaded by the code server

Seb Maynard 6 лет назад
Родитель
Сommit
bf381a9bbc
1 измененных файлов с 1 добавлено и 0 удалено
  1. 1 0
      src/erlydtl_runtime.erl

+ 1 - 0
src/erlydtl_runtime.erl

@@ -472,6 +472,7 @@ read_file(Module, Function, DocRoot, FileName, ReaderOptions) ->
             throw({read_file, AbsName, Reason})
     end.
 read_file_internal(Module, Function, FileName, ReaderOptions) ->
+    _ = code:ensure_loaded(Module),
     case erlang:function_exported(Module, Function,1) of
         true ->
             Module:Function(FileName);