Skip to content

Commit edc204f

Browse files
author
José Valim
committed
Make sure contents are not empty before decoding
Signed-off-by: José Valim <[email protected]>
1 parent 7d2cee2 commit edc204f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/mix/test/mix/tasks/release_test.exs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,12 @@ defmodule Mix.Tasks.ReleaseTest do
412412
end
413413

414414
defp wait_until_decoded(file) do
415-
wait_until(fn -> File.exists?(file) && file |> File.read!() |> :erlang.binary_to_term() end)
415+
wait_until(fn ->
416+
case File.read(file) do
417+
{:ok, bin} when byte_size(bin) > 0 -> :erlang.binary_to_term(bin)
418+
_ -> nil
419+
end
420+
end)
416421
end
417422

418423
defp wait_until(fun) do

0 commit comments

Comments
 (0)