🐛 fix(node): Handle potential null value for online users count

This commit is contained in:
web@ppanel 2025-03-29 23:43:21 +07:00
parent 8d49daca21
commit fa2fb2864f

View File

@ -38,7 +38,7 @@ export function NodeStatusCell({ status }: { status: API.NodeStatus }) {
const isOnline = updated_at > 0;
const badgeVariant = isOnline ? 'default' : 'destructive';
const badgeText = isOnline ? t('normal') : t('abnormal');
const onlineCount = Object.keys(online).length || 0;
const onlineCount = (online && Object.keys(online).length) || 0;
return (
<TooltipProvider>