Skip to content

Commit

Permalink
fix: fix #1772 (#1775)
Browse files Browse the repository at this point in the history
  • Loading branch information
Koenkk authored Sep 1, 2023
1 parent 1b88b6e commit 44ade96
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/features/composite/FeatureWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const FeatureWrapper: FunctionComponent<PropsWithChildren<FeatureWrapperP

const parentFeature = props.parentFeatures?.[props.parentFeatures.length - 1]
let label = feature.label;
if (feature.name === 'state' && !['light', 'switch'].includes(parentFeature.type)) {
if (parentFeature && feature.name === 'state' && !['light', 'switch'].includes(parentFeature.type)) {
label = `${parentFeature.label} ${feature.label.charAt(0).toLowerCase()}${feature.label.slice(1)}`;
}

Expand Down

0 comments on commit 44ade96

Please sign in to comment.