From b5d04a2031a766a203ce1998a1e401a6d0a8b963 Mon Sep 17 00:00:00 2001 From: Alexis Svinartchouk Date: Mon, 22 Jul 2019 17:45:27 +0200 Subject: [PATCH] Don't use wmic's ProviderName if it's empty Changelog-entry: Don't use wmic's ProviderName if it's empty Change-type: patch --- lib/gui/app/os/windows-network-drives.js | 2 ++ tests/data/wmic-output.txt | Bin 154 -> 178 bytes 2 files changed, 2 insertions(+) diff --git a/lib/gui/app/os/windows-network-drives.js b/lib/gui/app/os/windows-network-drives.js index a2abdfb3..b7dfe1da 100755 --- a/lib/gui/app/os/windows-network-drives.js +++ b/lib/gui/app/os/windows-network-drives.js @@ -107,6 +107,8 @@ const getWindowsNetworkDrives = async () => { // eslint-disable-next-line no-magic-numbers return [ str.slice(0, colonPosition + 1), _.trim(str.slice(colonPosition + 1)) ] }) + // eslint-disable-next-line no-magic-numbers + .filter((couple) => couple[1].length > 0) .value() return new Map(couples) } diff --git a/tests/data/wmic-output.txt b/tests/data/wmic-output.txt index 7d29b951459c7c71a575b8f1d514889261721c20..0b357c8c8ed4db777c03e69aa2f3601b2318aa07 100755 GIT binary patch delta 12 TcmbQmxQTJXtcf8a69ZTP9