Skip to content

Commit

Permalink
Fix error when tile.tileData contains an error
Browse files Browse the repository at this point in the history
  • Loading branch information
pkerpedjiev committed Nov 1, 2020
1 parent ebe133e commit 71c0207
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Arcs1DTrack.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
}
}
}

Expand Down

0 comments on commit 71c0207

Please sign in to comment.