Skip to content

fix nil ptr #1835

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 15, 2025
Merged

fix nil ptr #1835

merged 2 commits into from
Apr 15, 2025

Conversation

dvovk
Copy link
Contributor

@dvovk dvovk commented Apr 7, 2025

This pull request includes a small but important change to the perCPUTimes function in the cpu/cpu_darwin.go file. The change adds a check to ensure that the cpuload variable is not nil before proceeding, which helps prevent potential runtime errors.

  • cpu/cpu_darwin.go: Added a nil check for the cpuload variable in the perCPUTimes function to handle cases where host_processor_info might return a nil value.

Possible fix for: #1834

Copy link
Owner

@shirou shirou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. Thank you so much!

@shirou shirou merged commit ef5056a into shirou:master Apr 15, 2025
52 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants