diff --git a/lib/reducers/term-groups.js b/lib/reducers/term-groups.js index ad14152e..d5e44b65 100644 --- a/lib/reducers/term-groups.js +++ b/lib/reducers/term-groups.js @@ -152,7 +152,9 @@ const replaceParent = (state, parent, child) => { const removeGroup = (state, uid) => { const group = state.termGroups[uid]; - if (group.parentUid) { + // when close tab with multiple panes, it remove group from parent to child. so maybe the parentUid exists but parent group have removed. + // it's safe to remove the group. + if (group.parentUid && state.termGroups[group.parentUid]) { const parent = state.termGroups[group.parentUid]; const newChildren = parent.children.filter(childUid => childUid !== uid); if (newChildren.length === 1) {