Skip to content

Fix undefined error variable in stubs#76

Merged
JoshuaAFerguson merged 3 commits into
mainfrom
claude/fix-stubs-error-var-017QC8gWhzpztaUSwiDeo1az
Nov 18, 2025
Merged

Fix undefined error variable in stubs#76
JoshuaAFerguson merged 3 commits into
mainfrom
claude/fix-stubs-error-var-017QC8gWhzpztaUSwiDeo1az

Conversation

@JoshuaAFerguson

Copy link
Copy Markdown
Member

No description provided.

Fixed compilation errors in GetMetrics function where the err variable
was being used outside its scope. Declared err at function level and
updated assignments from := to = in nested blocks.

Fixes:
- internal/api/stubs.go:735: undefined: err
- internal/api/stubs.go:744: undefined: err
- internal/api/stubs.go:745: undefined: err
- internal/api/stubs.go:758: undefined: err
- internal/api/stubs.go:765: undefined: err
- internal/api/stubs.go:766: undefined: err
Fixed compilation errors by declaring nodes and pods variables at the
function level alongside err. This allows them to be properly assigned
within nested blocks without redeclaration.

Fixes:
- internal/api/stubs.go:689: undefined: nodes
- internal/api/stubs.go:694: undefined: nodes
- internal/api/stubs.go:697: undefined: nodes
- internal/api/stubs.go:719: undefined: pods
- internal/api/stubs.go:721: undefined: pods
Add optional chaining to safely check if userGroups.groups exists
before accessing its length property. This prevents the TypeError:
"can't access property 'length', b.groups is undefined" when the
groups property is not returned by the API.
@JoshuaAFerguson JoshuaAFerguson merged commit 7d18048 into main Nov 18, 2025
7 of 23 checks passed
@JoshuaAFerguson JoshuaAFerguson deleted the claude/fix-stubs-error-var-017QC8gWhzpztaUSwiDeo1az branch November 18, 2025 01:17
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