Skip to content

Commit

Permalink
check if the tile exists before accessing
Browse files Browse the repository at this point in the history
  • Loading branch information
Shane98c committed Feb 14, 2024
1 parent 6e624d2 commit 757f8b1
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/tiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -403,10 +403,9 @@ export const createTiles = (regl, opts) => {
tileIndex[0],
tileIndex[1]
)

if (!this.tiles[key].hasLoadedChunks(chunks)) {
if (!this.tiles[key]?.hasLoadedChunks(chunks)) {
const loadingID = this.setLoading('chunk')
await this.tiles[key].loadChunks(chunks)
await this.tiles[key]?.loadChunks(chunks)
this.clearLoading(loadingID)
}
})
Expand Down

0 comments on commit 757f8b1

Please sign in to comment.