1
0
Fork 0
mirror of synced 2024-07-02 04:50:44 +12:00

Fix crashing when adding a frontend component after deleting one

This commit is contained in:
Andrew Kingston 2020-10-13 08:20:32 +01:00
parent 08de0812fc
commit dcf31c971d

View file

@ -292,6 +292,11 @@ const addChildComponent = store => (componentToAdd, presetProps = {}) => {
? state.currentComponentInfo
: getParent(state.currentPreviewItem.props, state.currentComponentInfo)
// Don't continue if there's no parent
if (!targetParent) {
return state
}
targetParent._children = targetParent._children.concat(newComponent.props)
state.currentFrontEndType === "page"