Skip to content

Commit

Permalink
xy-output-component: check line chart reference before accessing it
Browse files Browse the repository at this point in the history
Signed-off-by: Bernd Hufmann <Bernd.Hufmann@ericsson.com>
  • Loading branch information
bhufmann committed Apr 9, 2020
1 parent 7957c69 commit 5b947ba
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ export class XYOutputComponent extends AbstractTreeOutputComponent<AbstractOutpu
if (prevProps.style.chartWidth !== this.props.style.chartWidth) {
this.updateXY();
}
this.lineChartRef.current.chartInstance.render();
if (this.lineChartRef.current) {
this.lineChartRef.current.chartInstance.render();
}
}

renderTree(): React.ReactNode {
Expand Down Expand Up @@ -265,4 +267,4 @@ export class XYOutputComponent extends AbstractTreeOutputComponent<AbstractOutpu
}
return colors[colorIndex];
}
}
}

0 comments on commit 5b947ba

Please sign in to comment.