Fix Analyzer.debug_info_line to return nil on with-fallthrough
When :beam_lib.chunks fails (e.g. a project module hasn't been loaded into :code.which yet), the existing with returned the raw error tuple as the 'line' value, which then crashed format/1 via String.Chars. Add an explicit else clause so the function always returns nil or an integer.
This commit is contained in:
parent
5184d2ee5e
commit
6f1d4eee4e
1 changed files with 2 additions and 0 deletions
|
|
@ -183,6 +183,8 @@ defmodule MixUnused.Analyzer do
|
|||
{{^name, ^arity}, _kind, meta, _clauses} -> Keyword.get(meta, :line)
|
||||
_ -> nil
|
||||
end)
|
||||
else
|
||||
_ -> nil
|
||||
end
|
||||
rescue
|
||||
_ -> nil
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue