File tree Expand file tree Collapse file tree
src/PowerShellEditorServices/Services/PowerShell/Host Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -593,6 +593,12 @@ internal void DisableTranscribeOnly()
593593
594594 internal Task SetProfileVariableAsync ( CancellationToken cancellationToken )
595595 {
596+ // If the CurrentUserCurrentHost profile is null then we cannot create the profile variable
597+ if ( _hostInfo . ProfilePaths . CurrentUserCurrentHost is null )
598+ {
599+ return Task . CompletedTask ;
600+ }
601+
596602 // NOTE: This is a special task run on startup!
597603 return ExecuteDelegateAsync (
598604 "SetProfileVariable" ,
@@ -603,6 +609,12 @@ internal Task SetProfileVariableAsync(CancellationToken cancellationToken)
603609
604610 internal Task LoadHostProfilesAsync ( CancellationToken cancellationToken )
605611 {
612+ // If the CurrentUserCurrentHost profile is null then we cannot instantiate
613+ if ( _hostInfo . ProfilePaths . CurrentUserCurrentHost is null )
614+ {
615+ return Task . CompletedTask ;
616+ }
617+
606618 // NOTE: This is a special task run on startup!
607619 return ExecuteDelegateAsync (
608620 "LoadProfiles" ,
You can’t perform that action at this time.
0 commit comments