diff --git a/plugins/gff3/src/Gff3Adapter/Gff3Adapter.ts b/plugins/gff3/src/Gff3Adapter/Gff3Adapter.ts index 78dad7872d..c0634f0bd2 100644 --- a/plugins/gff3/src/Gff3Adapter/Gff3Adapter.ts +++ b/plugins/gff3/src/Gff3Adapter/Gff3Adapter.ts @@ -25,7 +25,7 @@ export default class Gff3Adapter extends BaseFeatureDataAdapter { header: string intervalTreeMap: Record< string, - (sc?: (arg: string) => void) => IntervalTree + ((sc?: (arg: string) => void) => IntervalTree) | undefined > }> @@ -132,7 +132,7 @@ export default class Gff3Adapter extends BaseFeatureDataAdapter { try { const { start, end, refName } = query const { intervalTreeMap } = await this.loadData(opts) - intervalTreeMap[refName](opts.statusCallback) + intervalTreeMap[refName]?.(opts.statusCallback) ?.search([start, end]) .forEach(f => observer.next(f)) observer.complete()