Skip to content

Commit

Permalink
[Lens][Heatmap] Fallback to default option if is not found
Browse files Browse the repository at this point in the history
  • Loading branch information
mariairiartef committed Jan 13, 2025
1 parent 7bdae08 commit dcfd71e
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ export const AxisLabelOrientationSelector: React.FunctionComponent<
orientationOptions[0].id
}
onChange={(optionId: string) => {
const newOrientation = orientationOptions.find(({ id }) => id === optionId)!.value;
const newOrientation =
orientationOptions.find(({ id }) => id === optionId)?.value ??
orientationOptions[0].value;
setLabelOrientation(newOrientation);
}}
/>
Expand Down

0 comments on commit dcfd71e

Please sign in to comment.