Avoid error if detection images haven't been loaded yet

This commit is contained in:
Quincy Morgan
2020-10-29 12:10:33 -04:00
parent 981cdc6736
commit 791a3bfa45
2 changed files with 2 additions and 2 deletions

View File

@@ -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;
});
});
}

View File

@@ -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;
});
});
}