From 05bc81aaeb144d23adf14ffde6faa83c77834892 Mon Sep 17 00:00:00 2001 From: Sebastian Hildebrandt Date: Sun, 20 Mar 2022 20:08:14 +0100 Subject: [PATCH] diskLayout() fixed issue smartStatus (linux) --- CHANGELOG.md | 1 + docs/history.html | 5 +++++ docs/index.html | 2 +- lib/filesystem.js | 2 +- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 37559f8..0523acd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -80,6 +80,7 @@ For major (breaking) changes - **version 4, 3 and 2** - see end of page. | Version | Date | Comment | | -------------- | -------------- | -------- | +| 5.11.9 | 2022-03-20 | `diskLayout()` fixed issue smartStatus (linux) | | 5.11.8 | 2022-03-11 | `cpu()` improved socket detection by name (windows) | | 5.11.7 | 2022-03-10 | `cpuTemperature()` fix NaN issue (windows) | | 5.11.6 | 2022-03-01 | typescript typings fix `diskLayout()` | diff --git a/docs/history.html b/docs/history.html index ebbc3e2..a65f2a9 100644 --- a/docs/history.html +++ b/docs/history.html @@ -57,6 +57,11 @@ + + 5.11.9 + 2022-03-20 + diskLayout() fixed issue smartStatus (linux) + 5.11.8 2022-03-11 diff --git a/docs/index.html b/docs/index.html index a5677de..51624c3 100644 --- a/docs/index.html +++ b/docs/index.html @@ -170,7 +170,7 @@
systeminformation
 
-
New Version: 5.11.8
+
New Version: 5.11.9
diff --git a/lib/filesystem.js b/lib/filesystem.js index 50d9b05..0609edd 100644 --- a/lib/filesystem.js +++ b/lib/filesystem.js @@ -1247,7 +1247,7 @@ function diskLayout(callback) { const serialNum = smartData.serial_number; let i = util.findObjectByKey(result, 'serialNum', serialNum); if (i != -1) { - result[i].smartStatus = (smartData.smart_status.passed ? 'Ok' : (smartData.smart_status.passed === false ? 'Predicted Failure' : 'unknown')); + result[i].smartStatus = (smartData.smart_status && smartData.smart_status.passed ? 'Ok' : (smartData.smart_status && smartData.smart_status.passed === false ? 'Predicted Failure' : 'unknown')); if (smartData.temperature && smartData.temperature.current) { result[i].temperature = smartData.temperature.current; }