Skip to content

Commit

Permalink
馃獰 馃Ч check that stream is defined when matching (#20443)
Browse files Browse the repository at this point in the history
  • Loading branch information
teallarson committed Dec 13, 2022
1 parent e253205 commit 1c3557b
Showing 1 changed file with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,16 @@ const CatalogTreeComponent: React.FC<React.PropsWithChildren<CatalogTreeProps>>
const changedStreams = useMemo(
() =>
streams.filter((stream) => {
const matchingInitialValue = initialValues.syncCatalog.streams.find(
(initialStream) =>
initialStream.stream?.name === stream.stream?.name &&
initialStream.stream?.namespace === stream.stream?.namespace
);
const matchingInitialValue = initialValues.syncCatalog.streams.find((initialStream) => {
if (!stream.stream || !initialStream.stream) {
return false;
}

return (
initialStream.stream.name === stream.stream.name &&
initialStream.stream.namespace === stream.stream.namespace
);
});
return stream.config?.selected !== matchingInitialValue?.config?.selected;
}),
[initialValues.syncCatalog.streams, streams]
Expand Down

0 comments on commit 1c3557b

Please sign in to comment.