From 9c1124249575c8cab1cc8db9f2d1438125bb7787 Mon Sep 17 00:00:00 2001 From: Sebastian Hildebrandt Date: Tue, 19 Apr 2022 11:56:15 +0200 Subject: [PATCH] networkInterfaces() improved parsing (windows) --- CHANGELOG.md | 1 + docs/history.html | 5 +++++ docs/index.html | 2 +- lib/network.js | 2 +- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f33409..358ca8e 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.11 | 2022-04-19 | `networkInterfaces()` improved parsing (windows) | | 5.11.10 | 2022-04-18 | updated docs | | 5.11.9 | 2022-03-20 | `diskLayout()` fixed issue smartStatus (linux) | | 5.11.8 | 2022-03-11 | `cpu()` improved socket detection by name (windows) | diff --git a/docs/history.html b/docs/history.html index 77ec0b8..9f1ad0a 100644 --- a/docs/history.html +++ b/docs/history.html @@ -57,6 +57,11 @@ + + 5.11.11 + 2022-04-19 + networkInterfaces() improved parsing (windows) + 5.11.10 2022-04-18 diff --git a/docs/index.html b/docs/index.html index 14e4250..47857b9 100644 --- a/docs/index.html +++ b/docs/index.html @@ -170,7 +170,7 @@
systeminformation
 
-
New Version: 5.11.10
+
New Version: 5.11.11
diff --git a/lib/network.js b/lib/network.js index 6cac748..ea649a8 100644 --- a/lib/network.js +++ b/lib/network.js @@ -217,7 +217,7 @@ function parseLinesWindowsNics(sections, nconfigsections) { if (sections[i].trim() !== '') { let lines = sections[i].trim().split('\r\n'); - let linesNicConfig = nconfigsections[i].trim().split('\r\n'); + let linesNicConfig = nconfigsections && nconfigsections[i] ? nconfigsections[i].trim().split('\r\n') : []; let netEnabled = util.getValue(lines, 'NetEnabled', ':'); let adapterType = util.getValue(lines, 'AdapterTypeID', ':') === '9' ? 'wireless' : 'wired'; let ifacename = util.getValue(lines, 'Name', ':').replace(/\]/g, ')').replace(/\[/g, '(');