Skip to content
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

percent cpu calculation "cannot read property 'trim' of undefined" #7

Closed
kindohm opened this issue May 21, 2022 · 2 comments
Closed

Comments

@kindohm
Copy link
Contributor

kindohm commented May 21, 2022

Sometimes the facet server wasn't starting and I tracked it down to an error on this line:

let percent_cpu = Number(stdout.split('\n')[1].trim());

image

While debugging, I found stdout to be an empty string. Should probably guard against this.

I got around it by just setting the percent_cpu variable to a phony constant string.

Encountered this on Windows 10 and Max 8.2.2.

@nnirror nnirror closed this as completed May 24, 2022
@nnirror
Copy link
Owner

nnirror commented May 24, 2022

Great catch, thanks! I don't have a Windows machine to test, but this should safeguard against ever running .trim() on a non-string.

@nnirror
Copy link
Owner

nnirror commented May 24, 2022

Commit: 216ddb3

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

No branches or pull requests

2 participants