summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/supervisor2.erl5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/supervisor2.erl b/src/supervisor2.erl
index 36d0073257..8d6eaa371c 100644
--- a/src/supervisor2.erl
+++ b/src/supervisor2.erl
@@ -834,10 +834,9 @@ restart_child(Pid, Reason, State) ->
Children = State#state.children,
%% we still support >= R12-B3 in which lists:keyfind/3 doesn't exist
case lists:keysearch(Pid, #child.pid, Children) of
- {value, Child} ->
- RestartType = Child#child.restart_type,
+ {value, #child{restart_type = RestartType} = Child} ->
do_restart(RestartType, Reason, Child, State);
- _ ->
+ false ->
{ok, State}
end.