[SecuritySolution] Fix timeline saving / prevent epic from crashing (#171674)

## Summary

Fixes https://github.com/elastic/kibana/issues/168194

Under some circumstance, when navigating to the timelines page, we would
get a runtime exception for `state.tableById[action.id]` not being
defined. When that happened, the redux store would be in a broken state.

This PR makes the responsible destructuring assignment more save.
This commit is contained in:
Jan Monschke 2023-11-21 22:42:00 +01:00 committed by GitHub
parent e79ca5e9d6
commit 10f422836b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -95,7 +95,7 @@ export const dataTableReducer = reducerWithInitialState(initialDataTableState)
[action.id]: {
...state.tableById[action.id],
expandedDetail: {
...state.tableById[action.id].expandedDetail,
...state.tableById[action.id]?.expandedDetail,
...updateTableDetailsPanel(action),
},
},