From 95bbb7bf7c34a95e1be3f47010d416e771cae563 Mon Sep 17 00:00:00 2001 From: Stefan Date: Tue, 25 Nov 2025 19:12:59 +0100 Subject: [PATCH] fix: Handle undefined evaluation score in Tutor component - Add proper null check for evaluation.score before comparison - Prevents TypeScript build error in production build --- src/components/Tutor.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Tutor.tsx b/src/components/Tutor.tsx index 85a1249..d84ba14 100644 --- a/src/components/Tutor.tsx +++ b/src/components/Tutor.tsx @@ -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: