fix crash in zoomToEntity when entity has parent relations

This commit is contained in:
Martin Raifer
2024-05-31 14:14:26 +02:00
parent 3087b1a660
commit 379be391a3

View File

@@ -196,7 +196,9 @@ export function coreContext() {
const throttledZoomTo = _throttle(() => _map.zoomTo(loadedEntities), 500);
entityIDs.forEach(entityID => context.loadEntity(entityID, (err, result) => {
if (err) return;
loadedEntities.push(result.data.find(e => e.id === entityID));
const entity = result.data.find(e => e.id === entityID);
if (!entity) return;
loadedEntities.push(entity);
if (zoomTo !== false) {
throttledZoomTo();
}