diff --git a/devtools/client/framework/reducers/threads.js b/devtools/client/framework/reducers/threads.js index 46b90b739a96..7d539eb4d299 100644 --- a/devtools/client/framework/reducers/threads.js +++ b/devtools/client/framework/reducers/threads.js @@ -34,7 +34,13 @@ function threadsReducer(state = initialReducerState, action) { const threads = state.threads.filter( thread => thread._targetFront !== action.target ); - return { ...state, threads }; + + let { selected } = state; + if (selected._targetFront === action.target) { + selected = null; + } + + return { ...state, threads, selected }; } } return state;