From 5a4433c60c3bf5fa0543f21a682877aeba670645 Mon Sep 17 00:00:00 2001 From: Janet Vorobyeva Date: Tue, 12 Sep 2023 00:15:10 -0400 Subject: [PATCH] Fixes linking "srcSection disposed" bug (#670) Test "RawData should remove all tables except one (including referenced summary table)" was failing with error: "this._srcSection.activeRowId is not a function" added an extra isDisposed check to catch it --- app/client/components/LinkingState.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/client/components/LinkingState.ts b/app/client/components/LinkingState.ts index 7db6f134..af273e3c 100644 --- a/app/client/components/LinkingState.ts +++ b/app/client/components/LinkingState.ts @@ -308,10 +308,17 @@ export class LinkingState extends Disposable { //(we autodispose/return it at the end of the function) is this right? TODO JV return owner.autoDispose(ko.computed(() => { + if (this._srcSection.isDisposed()) { + //happened transiently in test: "RawData should remove all tables except one (...)" + console.warn("LinkingState._makeFilterObs: srcSectionDisposed"); + return EmptyFilterState; + } + //Get selector-rowId const srcRowId = this._srcSection.activeRowId(); + if (srcRowId === null) { - console.warn("_makeFilterObs activeRowId is null"); + console.warn("LinkingState._makeFilterObs activeRowId is null"); return EmptyFilterState; }