Skip to content

Commit

Permalink
Don't try to reply to failed cast messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Licenser committed Nov 4, 2015
1 parent 3d8a4e3 commit 756418e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/libchunter_fsm.erl
Expand Up @@ -83,7 +83,12 @@ connecting(_Event, #state{server=Server,
{ok, Socket} ->
{next_state, sending, State#state{socket = Socket}, 0};
_ ->
gen_server:reply(From, {error, connection_failed}),
case From of
Pid when is_pid(Pid) ->
gen_server:reply(From, {error, connection_failed});
_ ->
ok
end,
{next_state, closing, State, 0}
end.

Expand Down

0 comments on commit 756418e

Please sign in to comment.