diff --git a/src/app/modules/visualisation/visualisation-interface-diagram/visualisation-interface-diagram.component.ts b/src/app/modules/visualisation/visualisation-interface-diagram/visualisation-interface-diagram.component.ts index 5c5972b..c7f7788 100644 --- a/src/app/modules/visualisation/visualisation-interface-diagram/visualisation-interface-diagram.component.ts +++ b/src/app/modules/visualisation/visualisation-interface-diagram/visualisation-interface-diagram.component.ts @@ -61,12 +61,14 @@ export class VisualisationInterfaceDiagramComponent implements OnInit { try { const el = document.getElementsByTagName('app-visualisation-interface-diagram')[0]; - const rect = el.getBoundingClientRect(); - width = rect.width - margin; - height = rect.height - margin; + if (el) { + const rect = el.getBoundingClientRect(); + width = rect.width - margin; + height = rect.height - margin; + } } catch (error) { - console.error(error); + this.snackbarService.showError(error); } this.graph = graphviz('#graphviz-graph', {