From c08d6b98eb59cf8175de9ddf48fbf8ccb14aff8a Mon Sep 17 00:00:00 2001 From: Andrew Sikowitz Date: Wed, 14 Feb 2024 11:51:48 -0500 Subject: [PATCH] fix(ui/lineage): Do not crash on query entity (#9836) --- .../src/app/lineage/LineageExplorer.tsx | 44 ++++++++++--------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/datahub-web-react/src/app/lineage/LineageExplorer.tsx b/datahub-web-react/src/app/lineage/LineageExplorer.tsx index 28cd7025f5..a03f62f93a 100644 --- a/datahub-web-react/src/app/lineage/LineageExplorer.tsx +++ b/datahub-web-react/src/app/lineage/LineageExplorer.tsx @@ -113,26 +113,30 @@ export default function LineageExplorer({ urn, type }: Props) { ); const config = entityRegistry.getLineageVizConfig(entityAndType.type, entityAndType.entity); - config?.downstreamChildren?.forEach((downstream) => { - newAsyncEntities = extendAsyncEntities( - fineGrainedMap, - fineGrainedMapForSiblings, - newAsyncEntities, - entityRegistry, - downstream, - false, - ); - }); - config?.upstreamChildren?.forEach((downstream) => { - newAsyncEntities = extendAsyncEntities( - fineGrainedMap, - fineGrainedMapForSiblings, - newAsyncEntities, - entityRegistry, - downstream, - false, - ); - }); + config?.downstreamChildren + ?.filter((child) => child.type) + ?.forEach((downstream) => { + newAsyncEntities = extendAsyncEntities( + fineGrainedMap, + fineGrainedMapForSiblings, + newAsyncEntities, + entityRegistry, + downstream, + false, + ); + }); + config?.upstreamChildren + ?.filter((child) => child.type) + ?.forEach((downstream) => { + newAsyncEntities = extendAsyncEntities( + fineGrainedMap, + fineGrainedMapForSiblings, + newAsyncEntities, + entityRegistry, + downstream, + false, + ); + }); setAsyncEntities(newAsyncEntities); } },