Skip to content

os: add fallback for undefined CPUs

Rodrigo Muino Tomonari requested to merge github/fork/JungMinu/fix-25483 into master

Currently, for an unsupported OS, a call to os.cpus() throws an error within os.cpus() itself where it tries to get the length of undefined. This PR fixes the issue by adding fallback for undefined CPUs.

Fixes: https://github.com/nodejs/node/issues/25483

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

Merge request reports

Loading