Commit f07d9d0bb0ce5aec34790f51da20e3c5046c8968

Thomas de Grivel 2022-02-03T15:23:18

fix stack trace

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
diff --git a/lib/stack.ex b/lib/stack.ex
index 1f64c65..c97820c 100644
--- a/lib/stack.ex
+++ b/lib/stack.ex
@@ -7,11 +7,11 @@ defmodule Stack do
     str = "#{module}.#{fun}/#{arity}\n    #{file}:#{line}"
     to_string(rest, [str | acc])
   end
-  def to_string([{module, fun, arity, _} | rest], acc) do
+  def to_string([{module, fun, arity, _} | rest], acc) when is_list(module) do
     str = "#{module |> Enum.join(".")}.#{fun}/#{arity}"
     to_string(rest, [str | acc])
   end
-  def to_string([{module, fun, arity, _} | rest], acc) when is_list(module) do
+  def to_string([{module, fun, arity, _} | rest], acc) do
     str = "#{module |> Enum.join(".")}.#{fun}/#{arity}"
     to_string(rest, [str | acc])
   end