From 41398603df2213e20a8f34c7249a9461f0a870db Mon Sep 17 00:00:00 2001 From: Vladimir-Kokin <86053741+Vladimir-Kokin@users.noreply.github.com> Date: Thu, 27 Jun 2024 10:02:19 +0300 Subject: [PATCH] fix: Crash Removing Well Log in SLV (#2122) Fix a crash when removing Well Log from props in SLV close #2114 --- .../packages/well-log-viewer/src/SyncLogViewer.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/typescript/packages/well-log-viewer/src/SyncLogViewer.tsx b/typescript/packages/well-log-viewer/src/SyncLogViewer.tsx index 2691a8c27..4d9e601a2 100644 --- a/typescript/packages/well-log-viewer/src/SyncLogViewer.tsx +++ b/typescript/packages/well-log-viewer/src/SyncLogViewer.tsx @@ -547,7 +547,7 @@ class SyncLogViewer extends Component { } syncTrackScrollPos(iWellLog: number): void { - const controller = this.callbackManagers[iWellLog].controller; + const controller = this.callbackManagers[iWellLog]?.controller; if (!controller) return; const trackPos = controller.getTrackScrollPos(); for (const callbackManager of this.callbackManagers) { @@ -557,7 +557,7 @@ class SyncLogViewer extends Component { } } syncTrackSelection(iWellLog: number): void { - const controller = this.callbackManagers[iWellLog].controller; + const controller = this.callbackManagers[iWellLog]?.controller; if (!controller) return; const trackSelection = controller.getSelectedTrackIndices(); for (const callbackManager of this.callbackManagers) { @@ -711,7 +711,7 @@ class SyncLogViewer extends Component { skipSiblings: number[] = []; syncContentScrollPos(iWellLog: number): void { - const controller = this.callbackManagers[iWellLog].controller; + const controller = this.callbackManagers[iWellLog]?.controller; if (!controller) return; const domain = controller.getContentDomain(); @@ -814,7 +814,7 @@ class SyncLogViewer extends Component { } syncContentSelection(iWellLog: number): void { - const controller = this.callbackManagers[iWellLog].controller; + const controller = this.callbackManagers[iWellLog]?.controller; if (!controller) return; const selection = controller.getContentSelection(); for (const callbackManager of this.callbackManagers) { @@ -834,7 +834,7 @@ class SyncLogViewer extends Component { } syncTemplate(iWellLog: number): void { - const controller = this.callbackManagers[iWellLog].controller; + const controller = this.callbackManagers[iWellLog]?.controller; if (!controller) return; const template = controller.getTemplate(); for (const callbackManager of this.callbackManagers) {