diff options
author | Hans Nilsson <hans@erlang.org> | 2021-02-22 09:58:28 +0100 |
---|---|---|
committer | Hans Nilsson <hans@erlang.org> | 2021-02-22 09:58:28 +0100 |
commit | d7d3537c0606a22ad38e2641ac51bc7cdee0b383 (patch) | |
tree | 980d6365bc0a43a04c266f2e795161ee210f169d | |
parent | 705ff63f3dcde47258449dc86ef96847d410dfd1 (diff) | |
parent | b6974c0f4cf19910c100cc50dfab74adeddf6f25 (diff) | |
download | erlang-d7d3537c0606a22ad38e2641ac51bc7cdee0b383.tar.gz |
Merge branch 'hans/ssh/ssh_controller_timeout/ERIERL-581/OTP-17173' into maint
* hans/ssh/ssh_controller_timeout/ERIERL-581/OTP-17173:
ssh: Fix crash of controller
-rw-r--r-- | lib/ssh/src/ssh_controller.erl | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/lib/ssh/src/ssh_controller.erl b/lib/ssh/src/ssh_controller.erl index 4b8f5a7e8e..d8fbc8d0f2 100644 --- a/lib/ssh/src/ssh_controller.erl +++ b/lib/ssh/src/ssh_controller.erl @@ -104,11 +104,17 @@ handle_call({start_system_subsystem, Sup, Address, Port, Profile, Options, Child handle_call({stop_system,SysSup}, _From, D) -> - case supervisor:which_children(SysSup) of - [] -> - ssh_system_sup:stop_system(D#data.role, SysSup); - _X -> - ok + try + case supervisor:which_children(SysSup) of + [] -> + ssh_system_sup:stop_system(D#data.role, SysSup); + _X -> + ok + end + catch + _:_ -> + %% Already stopped (?) + skip end, {reply, ok, D}. |