diff --git a/src/graphEntry.ts b/src/graphEntry.ts index 8717878..36bb4b5 100644 --- a/src/graphEntry.ts +++ b/src/graphEntry.ts @@ -512,6 +512,7 @@ export default class GraphEntry { private _median(items: EntityCachePoints) { // eslint-disable-next-line @typescript-eslint/no-non-null-assertion const itemsDup = this._filterNulls([...items]).sort((a, b) => a[1]! - b[1]!); + if (itemsDup.length === 0) return null; const mid = Math.floor((itemsDup.length - 1) / 2); if (itemsDup.length % 2 === 1) return itemsDup[mid][1]; // eslint-disable-next-line @typescript-eslint/no-non-null-assertion