Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

Commit

Permalink
fix: do not crash when element child content is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
marionebl committed Sep 10, 2018
1 parent 7de5188 commit a1485c3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/container/element-list/element-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -361,10 +361,10 @@ export class ElementList extends React.Component {
return null;
}

const childrenContent = rootElement.getContentBySlotType(Types.SlotType.Children);

const anchors = {
[Components.ElementAnchors.content]: (rootElement.getContentBySlotType(
Types.SlotType.Children
) as Model.ElementContent).getId(),
[Components.ElementAnchors.content]: childrenContent ? childrenContent.getId() : '',
[Components.ElementAnchors.element]: rootElement.getId()
};

Expand All @@ -388,7 +388,7 @@ export class ElementList extends React.Component {
innerRef={ref => (this.ref = ref)}
>
<Components.Element.ElementChildren>
{childContent && <ElementContentContainer content={childContent} />}
{childContent ? <ElementContentContainer content={childContent} /> : null}
</Components.Element.ElementChildren>
<ElementDragImage
element={store.getDraggedElement()}
Expand Down

0 comments on commit a1485c3

Please sign in to comment.