fix: unsafely accessing draggingElement (#5216)

This commit is contained in:
David Luzar 2022-05-20 17:48:26 +02:00 committed by GitHub
parent 07ebd7c68c
commit 4a9fac2d1e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4432,7 +4432,7 @@ class App extends React.Component<AppProps, AppState> {
}), }),
selectedElementIds: { selectedElementIds: {
...prevState.selectedElementIds, ...prevState.selectedElementIds,
[this.state.draggingElement!.id]: true, [draggingElement.id]: true,
}, },
})); }));
} else { } else {
@ -4440,7 +4440,7 @@ class App extends React.Component<AppProps, AppState> {
draggingElement: null, draggingElement: null,
selectedElementIds: { selectedElementIds: {
...prevState.selectedElementIds, ...prevState.selectedElementIds,
[this.state.draggingElement!.id]: true, [draggingElement.id]: true,
}, },
})); }));
} }