Skip to content

Commit

Permalink
fix(tool): fix error caused by tools not having a parent
Browse files Browse the repository at this point in the history
  • Loading branch information
cbourget authored and mbarbeau committed Sep 25, 2019
1 parent f7a4a18 commit 67852c3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/integration/src/lib/context/context.state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,10 @@ export class ContextState {
tools.forEach(tool => {
if (tool.parent) {
const parentIndex = tools.findIndex(el => el.name === tool.parent);
tools[parentIndex].children = [];
tools[parentIndex].children.push(tool.name);
if (parentIndex !== -1) {
tools[parentIndex].children = [];
tools[parentIndex].children.push(tool.name);
}
}
});

Expand Down

0 comments on commit 67852c3

Please sign in to comment.