From 1b1552c94dc52b748e137f4e00df67556ea92091 Mon Sep 17 00:00:00 2001 From: Sebastian Hildebrandt Date: Wed, 4 Oct 2023 20:22:56 +0200 Subject: [PATCH] wifiNetworks() improved parsing (mac OS) --- CHANGELOG.md | 1 + docs/history.html | 5 +++++ docs/index.html | 4 ++-- lib/wifi.js | 8 ++++++-- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d8a0385..2b0f9b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -83,6 +83,7 @@ For major (breaking) changes - **version 4, 3 and 2** - see end of page. | Version | Date | Comment | | ------- | ---------- | --------------------------------------------------------------------------------------------------- | +| 5.21.10 | 2023-10-04 | `wifiNetworks()` improved parsing (macOS) | | 5.21.9 | 2023-09-25 | `general` code cleanup | | 5.21.8 | 2023-09-20 | `battery()` fixed parsing (linux) | | 5.21.7 | 2023-09-19 | `wifiConnections()` `wifiNetworks()` fixed security issue (linux) | diff --git a/docs/history.html b/docs/history.html index 68e35b1..4e20045 100644 --- a/docs/history.html +++ b/docs/history.html @@ -57,6 +57,11 @@ + + 5.21.10 + 2023-10-04 + wifiNetworks() improved parsing (macOS) + 5.21.9 2023-09-25 diff --git a/docs/index.html b/docs/index.html index 84b2929..1edba66 100644 --- a/docs/index.html +++ b/docs/index.html @@ -170,7 +170,7 @@
systeminformation
 
-
New Version: 5.21.9
+
New Version: 5.21.10
@@ -212,7 +212,7 @@
Downloads last month
-
650
+
658
Dependents
diff --git a/lib/wifi.js b/lib/wifi.js index 8b35de8..666ae49 100644 --- a/lib/wifi.js +++ b/lib/wifi.js @@ -366,8 +366,12 @@ function parseWifiDarwin(wifiObj) { }); } } - if (wifiItem.SSID) { - ssid = Buffer.from(wifiItem.SSID, 'base64').toString('utf8'); + if (wifiItem.SSID && ssid === '') { + try { + ssid = Buffer.from(wifiItem.SSID, 'base64').toString('utf8'); + } catch (err) { + util.noop(); + } } result.push({ ssid,