Skip to content

Commit

Permalink
fix: Crash Removing Well Log in SLV (#2122)
Browse files Browse the repository at this point in the history
Fix a crash when removing Well Log from props in SLV

close #2114
  • Loading branch information
Vladimir-Kokin authored Jun 27, 2024
1 parent 7f619c2 commit 4139860
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions typescript/packages/well-log-viewer/src/SyncLogViewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ class SyncLogViewer extends Component<SyncLogViewerProps, State> {
}

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) {
Expand All @@ -557,7 +557,7 @@ class SyncLogViewer extends Component<SyncLogViewerProps, State> {
}
}
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) {
Expand Down Expand Up @@ -711,7 +711,7 @@ class SyncLogViewer extends Component<SyncLogViewerProps, State> {

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();
Expand Down Expand Up @@ -814,7 +814,7 @@ class SyncLogViewer extends Component<SyncLogViewerProps, State> {
}

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) {
Expand All @@ -834,7 +834,7 @@ class SyncLogViewer extends Component<SyncLogViewerProps, State> {
}

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) {
Expand Down

0 comments on commit 4139860

Please sign in to comment.