fix: Guard against undefined stats in AdminDashboard formatValue
All checks were successful
Test Asgard Runner / test (push) Successful in 3s
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:
@@ -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)}`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user