Skip to content

Commit

Permalink
fix(pwsh): validate existence of global variable
Browse files Browse the repository at this point in the history
  • Loading branch information
JanDeDobbeleer committed Apr 27, 2022
1 parent fccdfe5 commit 2b92304
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/shell/scripts/omp.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}
Expand Down

0 comments on commit 2b92304

Please sign in to comment.