fix: Guard against undefined stats in AdminDashboard formatValue
All checks were successful
Test Asgard Runner / test (push) Successful in 3s

API returns partial/empty stats object — individual fields can be undefined
even when the object exists. Added null guard to prevent toLocaleString crash.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Vantz Stockwell
2026-02-15 21:49:20 -05:00
parent e849d7803c
commit daa9c3035f

View File

@@ -35,7 +35,8 @@ const quickLinks = [
{ label: 'Servers', description: 'Monitor connected game servers', icon: MonitorCog, route: '/platform-admin/servers' },
]
function formatValue(value: number, format: string): string {
function formatValue(value: number | undefined, format: string): string {
if (value == null) return '\u2014'
if (format === 'currency') {
return `$${value.toFixed(2)}`
}