fix: add optional chaining to stepBeadHighlights access
Add optional chaining (?.) when accessing stepBeadHighlights to handle cases where it may be undefined. Provides fallback to empty array when stepBeadHighlights is not present, preventing potential runtime errors. Fixes potential TS18048 error in progressive-test-suite. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -49,9 +49,9 @@ const ProgressiveTestComponent: React.FC<{
|
||||
|
||||
stepIndices.forEach((stepIndex, i) => {
|
||||
const description = fullInstruction.multiStepInstructions?.[i] || `Step ${i + 1}`
|
||||
const stepBeads = fullInstruction.stepBeadHighlights.filter(
|
||||
const stepBeads = fullInstruction.stepBeadHighlights?.filter(
|
||||
(bead) => bead.stepIndex === stepIndex
|
||||
)
|
||||
) || []
|
||||
|
||||
// Calculate the value change for this step by applying all bead movements
|
||||
let valueChange = 0
|
||||
|
||||
Reference in New Issue
Block a user