Skip to content

Commit

Permalink
fix(attribute-picker): picking "select attribute" crashes (#1704)
Browse files Browse the repository at this point in the history
  • Loading branch information
afharo authored Apr 3, 2023
1 parent 68095f4 commit 113cb46
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/components/attribute-picker/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@ export default function AttributePicker(props: AttributePickerProps & Omit<Input
const { value: inputValue } = e.target;
const currentCluster = Clusters[cluster];
const attributeInfo = currentCluster.attributes[inputValue]
onChange(inputValue, attributeInfo);
// inputValue could be "Select attribute" which isn't a proper cluster attribute
if (attributeInfo) {
onChange(inputValue, attributeInfo);
}
}

// eslint-disable-next-line @typescript-eslint/no-unused-vars

let attrs = [] as string[];
const clusterDefinition = Clusters[cluster];
if (clusterDefinition) {
Expand Down

0 comments on commit 113cb46

Please sign in to comment.