fix(pwsh): validate existence of global variable

This commit is contained in:
Jan De Dobbeleer 2022-04-27 20:28:25 +02:00 committed by Jan De Dobbeleer
parent fccdfe5306
commit 2b92304c77

View file

@ -272,7 +272,7 @@ Example:
$stackCount = (Get-Location -Stack).Count
try {
if ($null -ne $global:OMP_GLOBAL_SESSIONSTATE) {
if (Test-Path variable:global:OMP_GLOBAL_SESSIONSTATE) {
$stackCount = $global:OMP_GLOBAL_SESSIONSTATE.Path.LocationStack('').Count
}
} catch {}