Skip to content

Commit

Permalink
Edge case from gremlin attack
Browse files Browse the repository at this point in the history
  • Loading branch information
David-Desmaisons committed Sep 26, 2019
1 parent 87b1ba4 commit 8083912
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Tree.vue
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,8 @@ export default {
const leaves = root.leaves()
const extremeNodes = text.filter(d => leaves.indexOf(d) !== -1).nodes()
const last = Math.max(...extremeNodes.map(node => node.getComputedTextLength())) + leafTextMargin
const first = text.node().getComputedTextLength() + leafTextMargin
const textNode = text.node()
const first = (textNode ? textNode.getComputedTextLength() : 0) + leafTextMargin
if (last <= this.maxTextLenght.last && first <= this.maxTextLenght.first) {
this._scheduledRedraw = false
return Promise.all([allNodesPromise, exitingNodesPromise, updateAndNewLinksPromise, exitingLinksPromise])
Expand Down

0 comments on commit 8083912

Please sign in to comment.