Skip to content

Commit d002950

Browse files
committed
Avoid crash if $rank isn't stringy.
1 parent 3fdc59a commit d002950

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/components/DriverName.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import styled, { css } from 'styled-components';
33
const DriverNameInner = styled.span`
44
55
${
6-
props => props.theme.driverRanks[props.$rank?.replace('driver-', '')] && css`
6+
props => typeof(props.$rank?.replace) === 'function' && props.theme.driverRanks[props.$rank.replace('driver-', '')] && css`
77
&::before {
8-
color: ${props.theme.driverRanks[props.$rank?.replace('driver-', '')]};
8+
color: ${props.theme.driverRanks[props.$rank.replace('driver-', '')]};
99
content: '●';
1010
margin-right: 4px;
1111
font-style: normal;

0 commit comments

Comments
 (0)