Skip to content

Commit a825a55

Browse files
committed
Work around empty path variables
1 parent 1246f9d commit a825a55

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Source/Configuration.psm1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ function InitializeStoragePaths {
5959
if(!($MachineData = $MyInvocation.MyCommand.Module.PrivateData.PathOverride.MachineData)) {
6060
if($IsLinux -or $IsMacOs) {
6161
# Defaults to /etc/xdg elsewhere
62-
$XdgConfigDirs = $Env:XDG_CONFIG_DIRS -split ([IO.Path]::PathSeparator) | Where-Object { Test-Path $_ }
62+
$XdgConfigDirs = $Env:XDG_CONFIG_DIRS -split ([IO.Path]::PathSeparator) | Where-Object { $_ -and (Test-Path $_) }
6363
if(!($MachineData = if($XdgConfigDirs.Count -gt 1) { $XdgConfigDirs[1]})) {
6464
$MachineData = "/etc/xdg/"
6565
}

0 commit comments

Comments
 (0)