Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

Early return if def undefined (#6385)

Tom Cariellof7335b0d1dba
diff --git a/web/js/containers/map-interactions/ol-vector-interactions.js b/web/js/containers/map-interactions/ol-vector-interactions.js
index 94a30e801..437767219 100644
--- a/web/js/containers/map-interactions/ol-vector-interactions.js
+++ b/web/js/containers/map-interactions/ol-vector-interactions.js
@@ -127,12 +127,13 @@ export class VectorInteractions extends React.Component {
map.forEachFeatureAtPixel(pixel, (feature, layer) => {
if (!layer) return;
const def = lodashGet(layer, 'wv.def');
+ if (!def) return;
if (def?.layergroup === 'Reference') isReferenceLayer = true;
const layerExtent = layer.get('extent');
const pixelCoords = map.getCoordinateFromPixel(pixel);
const featureOutsideExtent = layerExtent
&& !olExtent.containsCoordinate(layerExtent, pixelCoords);
- if (!def || lodashIncludes(def.clickDisabledFeatures, feature.getGeometry().getType())
+ if (lodashIncludes(def.clickDisabledFeatures, feature.getGeometry().getType())
|| featureOutsideExtent) return;
const isWrapped = proj.id === 'geographic' && (def.wrapadjacentdays || def.wrapX);
const isRenderedFeature = isWrapped ? lon > -250