Browse Source

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

Seb Maynard 6 years ago
parent
commit
bf381a9bbc
1 changed files with 1 additions and 0 deletions
  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);