Skip to content

Commit

Permalink
fix: check if node.prop is defined
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Maier committed Nov 28, 2021
1 parent c2db1d4 commit 28bb07d
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/dagre-wrapper/nodes.js
Original file line number Diff line number Diff line change
Expand Up @@ -325,14 +325,16 @@ const rect = (parent, node) => {
.attr('width', totalWidth)
.attr('height', totalHeight);

const propKeys = new Set(Object.keys(node.props));
if (node.props?.borders) {
applyNodePropertyBorders(rect, node.props.borders, totalWidth, totalHeight);
propKeys.delete('borders');
if (node.props) {
const propKeys = new Set(Object.keys(node.props));
if (node.props.borders) {
applyNodePropertyBorders(rect, node.props.borders, totalWidth, totalHeight);
propKeys.delete('borders');
}
propKeys.forEach((propKey) => {
log.warn(`Unknown node property ${propKey}`);
});
}
propKeys.forEach((propKey) => {
log.warn(`Unknown node property ${propKey}`);
});

updateNodeBounds(node, rect);

Expand Down

0 comments on commit 28bb07d

Please sign in to comment.