From e8db3d1d06b56ebef19bbd4516a35e6ddba3c897 Mon Sep 17 00:00:00 2001 From: Geoffrey Delric <81676743+gdelric-capgemini@users.noreply.github.com> Date: Wed, 18 Dec 2024 19:37:00 +0100 Subject: [PATCH] Update visualisation-interface-diagram.component.ts --- .../visualisation-interface-diagram.component.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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', {