Fix 'badarg' crash
This commit is contained in:
commit
a68e3f265d
|
@ -648,11 +648,14 @@ handle_info(Info, State) ->
|
||||||
terminate(Reason, #state{will_msg = WillMsg, conn_pid = ConnPid}) ->
|
terminate(Reason, #state{will_msg = WillMsg, conn_pid = ConnPid}) ->
|
||||||
%% Should not run hooks here.
|
%% Should not run hooks here.
|
||||||
%% emqx_hooks:run('session.terminated', [#{client_id => ClientId}, Reason]),
|
%% emqx_hooks:run('session.terminated', [#{client_id => ClientId}, Reason]),
|
||||||
|
%% Let it crash.
|
||||||
|
%% emqx_sm:unregister_session(ClientId),
|
||||||
send_willmsg(WillMsg),
|
send_willmsg(WillMsg),
|
||||||
%% Ensure to shutdown the connection
|
%% Ensure to shutdown the connection
|
||||||
(ConnPid =:= undefined) orelse ConnPid ! {shutdown, Reason}.
|
if
|
||||||
%% Let it crash.
|
ConnPid == undefined -> ok;
|
||||||
%% emqx_sm:unregister_session(ClientId).
|
true -> ConnPid ! {shutdown, Reason}
|
||||||
|
end.
|
||||||
|
|
||||||
code_change(_OldVsn, State, _Extra) ->
|
code_change(_OldVsn, State, _Extra) ->
|
||||||
{ok, State}.
|
{ok, State}.
|
||||||
|
|
Loading…
Reference in New Issue