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
This commit is contained in:
Janet Vorobyeva 2023-09-12 00:15:10 -04:00 committed by GitHub
parent 5d7ef23433
commit 5a4433c60c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;
}