From 71c020762fa57a8f95bce021b90eb807dfc8d09f Mon Sep 17 00:00:00 2001 From: Peter Kerpedjiev Date: Sun, 1 Nov 2020 08:41:24 -0500 Subject: [PATCH] Fix error when tile.tileData contains an error --- src/Arcs1DTrack.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Arcs1DTrack.js b/src/Arcs1DTrack.js index f6877c2..cf47937 100644 --- a/src/Arcs1DTrack.js +++ b/src/Arcs1DTrack.js @@ -13,11 +13,13 @@ const Arcs1DTrack = (HGC, ...args) => { renderTile(tile) {} maxWidth() { - let maxWidth = 0; + let maxWidth = 1; for (const tile of Object.values(this.fetchedTiles)) { - for (const item of tile.tileData) { - maxWidth = Math.max(maxWidth, item.fields[2] - item.fields[1]); + if (tile.tileData && !tile.tileData.error) { + for (const item of tile.tileData) { + maxWidth = Math.max(maxWidth, item.fields[2] - item.fields[1]); + } } }