Skip to content

Commit

Permalink
Fix exception in CatalogSection when jsonSchema does not have a direc…
Browse files Browse the repository at this point in the history
…t properties value (#22227)
  • Loading branch information
edmundito committed Feb 1, 2023
1 parent d4bfcf3 commit 91037bd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ const CatalogSectionInner: React.FC<CatalogSectionInnerProps> = ({
return traversedFields.sort(naturalComparatorBy((field) => field.cleanedName));
}, [stream?.jsonSchema, stream?.name]);

const numberOfFieldsInStream = Object.keys(streamNode?.stream?.jsonSchema?.properties).length ?? 0;
// FIXME: Temp fix to return empty object when the json schema does not have .properties
// This prevents the table from crashing but still will not render the fields in the stream.
const streamProperties = streamNode?.stream?.jsonSchema?.properties ?? {};
const numberOfFieldsInStream = Object.keys(streamProperties).length ?? 0;

const {
destDefinitionSpecification: { supportedDestinationSyncModes },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ export const CheckboxCell = styled(HeaderCell)`
`;

export const ArrowCell = styled(HeaderCell)`
min-width: 40px;
max-width: 40px;
width: 40px;
`;

export const NameContainer = styled.span`
Expand Down

0 comments on commit 91037bd

Please sign in to comment.