fix(planner): guard scoreDelta against undefined in RecipePicker badge

Defensive null-coalescing prevents crash when suggestion data arrives
without scoreDelta (e.g. stale backend or mismatched schema).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-09 12:00:37 +02:00
parent ab66269131
commit 387d0705a4

View File

@@ -121,7 +121,7 @@
data-type="good"
style="display: inline-block; margin-top: 3px; font-size: 8px; font-weight: 500; padding: 1px 5px; border-radius: 3px; background: var(--green-tint); color: var(--green-dark);"
>
↑ +{suggestion.scoreDelta.toFixed(0)} Punkte
↑ +{(suggestion.scoreDelta ?? 0).toFixed(0)} Punkte
</span>
{:else}
<span