fix(canvas): fix del key error when nothing is selected (#69)

This commit is contained in:
chilingling 2023-11-09 01:01:59 -08:00 committed by GitHub
parent d1f0a35950
commit da0fbd1e28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -205,6 +205,10 @@ export const removeNode = ({ parent, node }) => {
}
export const removeNodeById = (id) => {
if (!id) {
return
}
removeNode(getNode(id, true))
clearSelect()
getController().addHistory()