From a3d1a8abdbe779533df78fba21f7ec549b0e4394 Mon Sep 17 00:00:00 2001 From: Benjamin Schmidt Date: Tue, 10 Sep 2024 18:12:24 -0400 Subject: [PATCH] include return value --- src/aesthetics/Aesthetic.ts | 5 +++-- src/selection.ts | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/aesthetics/Aesthetic.ts b/src/aesthetics/Aesthetic.ts index 4efcf66f9..4c1ef3b49 100644 --- a/src/aesthetics/Aesthetic.ts +++ b/src/aesthetics/Aesthetic.ts @@ -122,9 +122,10 @@ export abstract class Aesthetic< for (let i = 0; i < this.subfield.length; i++) { v = v[this.subfield[i]] as Input['domainType']; } + return v; + // Needs a default perhaps? + return null; } - // Needs a default perhaps? - return null; } get map_position() { diff --git a/src/selection.ts b/src/selection.ts index 3f5e4a849..1a7505c97 100644 --- a/src/selection.ts +++ b/src/selection.ts @@ -817,8 +817,8 @@ export class DataSelection { if (i === undefined) { i = this.cursor; } - if (i > this.selectionSize) { - undefined; + if (i >= this.selectionSize) { + throw new Error('Index out of bounds'); } let currentOffset = 0; let relevantTile: Tile | undefined = undefined;