From 791a3bfa4507444870eb88ea10a8ee7054f8dd67 Mon Sep 17 00:00:00 2001 From: Quincy Morgan <2046746+quincylvania@users.noreply.github.com> Date: Thu, 29 Oct 2020 12:10:33 -0400 Subject: [PATCH] Avoid error if detection images haven't been loaded yet --- modules/svg/mapillary_map_features.js | 2 +- modules/svg/mapillary_signs.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/svg/mapillary_map_features.js b/modules/svg/mapillary_map_features.js index c6ef91442..bbd1763db 100644 --- a/modules/svg/mapillary_map_features.js +++ b/modules/svg/mapillary_map_features.js @@ -113,7 +113,7 @@ export function svgMapillaryMapFeatures(projection, context, dispatch) { return feature.detections.some(function(detection) { var imageKey = detection.image_key; var image = service.cachedImage(imageKey); - return usernames.indexOf(image.captured_by) !== -1; + return image && usernames.indexOf(image.captured_by) !== -1; }); }); } diff --git a/modules/svg/mapillary_signs.js b/modules/svg/mapillary_signs.js index 4e3906b11..800424c24 100644 --- a/modules/svg/mapillary_signs.js +++ b/modules/svg/mapillary_signs.js @@ -114,7 +114,7 @@ export function svgMapillarySigns(projection, context, dispatch) { return feature.detections.some(function(detection) { var imageKey = detection.image_key; var image = service.cachedImage(imageKey); - return usernames.indexOf(image.captured_by) !== -1; + return image && usernames.indexOf(image.captured_by) !== -1; }); }); }