From 8312a6041a32a82d670a88a8261ced31d54c9be2 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Fri, 27 Mar 2020 17:41:15 +0200 Subject: [PATCH] more resilient paint check in setFeatureState --- src/source/tile.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/source/tile.js b/src/source/tile.js index 95278e01985..dcb8120bf2b 100644 --- a/src/source/tile.js +++ b/src/source/tile.js @@ -404,8 +404,8 @@ class Tile { if (!sourceLayer || !sourceLayerStates || Object.keys(sourceLayerStates).length === 0) continue; bucket.update(sourceLayerStates, sourceLayer, this.imageAtlas && this.imageAtlas.patternPositions || {}); - const layer = painter.style.getLayer(id); - if (painter && painter.style && layer.paint) { + const layer = painter && painter.style && painter.style.getLayer(id); + if (layer && layer.paint) { this.queryPadding = Math.max(this.queryPadding, layer.queryRadius(bucket)); } }