Skip to content

Commit cb6cd75

Browse files
author
José Valim
committed
Only invoke callback if file was on queue
1 parent d9d3f79 commit cb6cd75

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

lib/elixir/lib/kernel/parallel_compiler.ex

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,12 @@ defmodule Kernel.ParallelCompiler do
217217
spawn_compilers(%{state | waiting: waiting})
218218

219219
{:timed_out, child} ->
220-
if callback = Keyword.get(options, :each_long_compilation) do
221-
{^child, _, file, _} = List.keyfind(queued, child, 0)
222-
callback.(file)
220+
callback = Keyword.get(options, :each_long_compilation)
221+
case List.keyfind(queued, child, 0) do
222+
{^child, _, file, _} when not is_nil(callback) ->
223+
callback.(file)
224+
_ ->
225+
:ok
223226
end
224227
spawn_compilers(state)
225228

0 commit comments

Comments
 (0)