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:
Thomas Hallock
2025-10-07 15:39:12 -05:00
parent 9c71092278
commit a5fac5c75c

View File

@@ -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