diff --git a/CHANGELOG.md b/CHANGELOG.md index 658139a..35a21f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ For major (breaking) changes - version 3 and 2 see end of page. | Version | Date | Comment | | -------------- | -------------- | -------- | +| 4.14.9 | 2019-10-01 | `processLoad()` fix windows | | 4.14.8 | 2019-08-22 | `parseDateTime()` fix coding error | | 4.14.7 | 2019-08-22 | `battery()` windows acconnected improvement | | 4.14.6 | 2019-08-22 | `users()` improved date time parsing | diff --git a/docs/history.html b/docs/history.html index 3e8df78..3f9c161 100644 --- a/docs/history.html +++ b/docs/history.html @@ -83,6 +83,11 @@ + + 4.14.9 + 2019-10-01 + processLoad() fix windows + 4.14.8 2019-08-23 diff --git a/docs/index.html b/docs/index.html index a6f3182..bbfcd6a 100644 --- a/docs/index.html +++ b/docs/index.html @@ -168,7 +168,7 @@
systeminformation
-
Current Version: 4.14.8
+
Current Version: 4.14.9
diff --git a/lib/processes.js b/lib/processes.js index 34b1fc0..8fb9924 100644 --- a/lib/processes.js +++ b/lib/processes.js @@ -867,9 +867,11 @@ function processLoad(proc, callback) { let resultProcess = calcProcStatWin(procStats[i], allcpuu + allcpus, _process_cpu); // store pcpu in outer array - let listPos = result.pids.indexOf(resultProcess.pid); - if (listPos >= 0) { - result.cpu = resultProcess.pcpuu + resultProcess.pcpus; + if (result && result.pids && result.pids.length > 0) { + let listPos = result.pids.indexOf(resultProcess.pid); + if (listPos >= 0) { + result.cpu = resultProcess.pcpuu + resultProcess.pcpus; + } } // save new values