Skip to content

Commit

Permalink
Check that the node exists before trying to access its id fixes #4162 (
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleAMathews authored Feb 21, 2018
1 parent cc9dbdf commit b3c8a45
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,12 @@ const findDirtyIds = actions => {
return actions.reduce((dirtyIds, action) => {
const node = action.payload

// find invalid pagesAndLayouts
if (!node || !node.id || !node.internal.type) return dirtyIds

// Find pagesAndLayouts that depend on this node so are now dirty.
dirtyIds = dirtyIds.concat(state.componentDataDependencies.nodes[node.id])

// Find invalid connections
// Find connections that depend on this node so are now invalid.
dirtyIds = dirtyIds.concat(
state.componentDataDependencies.connections[node.internal.type]
)
Expand Down

0 comments on commit b3c8a45

Please sign in to comment.