Skip to content

Fix undefined totalCapacity error in Nodes component#82

Merged
JoshuaAFerguson merged 2 commits into
mainfrom
claude/fix-totalcapacity-undefined-01KDfgLP27Gg7GkqKmupyZXJ
Nov 18, 2025
Merged

Fix undefined totalCapacity error in Nodes component#82
JoshuaAFerguson merged 2 commits into
mainfrom
claude/fix-totalcapacity-undefined-01KDfgLP27Gg7GkqKmupyZXJ

Conversation

@JoshuaAFerguson

Copy link
Copy Markdown
Member

No description provided.

Add optional chaining and nullish coalescing to safely access
stats.totalCapacity.cpu and stats.totalCapacity.memory properties.
When totalCapacity is undefined, displays 'N/A' instead of crashing.
- Add optional chaining for totalCapacity.cpu and totalCapacity.memory
- Add null checks for node properties (allocatable, info, labels, taints)
- Add empty state message when no nodes are found
- Show helpful troubleshooting hints for cluster connectivity issues

Prevents TypeErrors when API returns incomplete or undefined node data.
@JoshuaAFerguson JoshuaAFerguson merged commit 64e1408 into main Nov 18, 2025
7 of 23 checks passed
@JoshuaAFerguson JoshuaAFerguson deleted the claude/fix-totalcapacity-undefined-01KDfgLP27Gg7GkqKmupyZXJ branch November 18, 2025 03:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants