Skip to content

Commit 5319f85

Browse files
talissoncostaclaude
andcommitted
Fix TypeError when accessing feature_state_value properties
Add undefined checks alongside null checks to prevent "Cannot read properties of undefined (reading 'toString')" error when feature_state_value properties are undefined. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent 4e25dbf commit 5319f85

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/components/FlagsTab.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -379,25 +379,25 @@ const ExpandableRow = ({
379379
{/* Feature State Value */}
380380
{state.feature_state_value && (
381381
<Box mt={1}>
382-
{state.feature_state_value.string_value !==
383-
null && (
382+
{state.feature_state_value.string_value !== null &&
383+
state.feature_state_value.string_value !== undefined && (
384384
<Typography variant="body2">
385385
<strong>Value:</strong>{' '}
386386
{state.feature_state_value.string_value}
387387
</Typography>
388388
)}
389-
{state.feature_state_value.integer_value !==
390-
null && (
389+
{state.feature_state_value.integer_value !== null &&
390+
state.feature_state_value.integer_value !== undefined && (
391391
<Typography variant="body2">
392392
<strong>Value:</strong>{' '}
393393
{state.feature_state_value.integer_value}
394394
</Typography>
395395
)}
396-
{state.feature_state_value.boolean_value !==
397-
null && (
396+
{state.feature_state_value.boolean_value !== null &&
397+
state.feature_state_value.boolean_value !== undefined && (
398398
<Typography variant="body2">
399399
<strong>Value:</strong>{' '}
400-
{state.feature_state_value.boolean_value.toString()}
400+
{String(state.feature_state_value.boolean_value)}
401401
</Typography>
402402
)}
403403
</Box>

0 commit comments

Comments
 (0)