fix: Handle undefined evaluation score in Tutor component

- Add proper null check for evaluation.score before comparison
- Prevents TypeScript build error in production build
This commit is contained in:
Stefan
2025-11-25 19:12:59 +01:00
parent cd6cab367a
commit 95bbb7bf7c
+1 -1
View File
@@ -251,7 +251,7 @@ User Question: ${text}
Current Position Data:
- Best Move: ${evaluation?.bestMove}
- Evaluation: ${evaluation?.score} centipawns ${evaluation?.score > 0 ? '(White is better)' : evaluation?.score < 0 ? '(Black is better)' : '(Equal)'}
- Evaluation: ${evaluation?.score ?? 'N/A'} centipawns ${evaluation?.score !== undefined ? (evaluation.score > 0 ? '(White is better)' : evaluation.score < 0 ? '(Black is better)' : '(Equal)') : ''}
- Mate in: ${evaluation?.mate || 'None'}
INSTRUCTIONS: