Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Null dereference when debugging Pester tests #1672

Closed
andyleejordan opened this issue Jan 19, 2022 · 0 comments · Fixed by #1670
Closed

Null dereference when debugging Pester tests #1672

andyleejordan opened this issue Jan 19, 2022 · 0 comments · Fixed by #1670
Labels
Needs: Triage Maintainer attention needed!

Comments

@andyleejordan
Copy link
Member

@andschwa Sadly I just hit this in Pester on v2022.1.0 while debugging. I'll try to get a better repro together.

EDIT: Only seems to trigger in debug, non-debug it doesn't happen.

image

An error occurred while running the REPL loop:
System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.PowerShell.EditorServices.Services.PowerShell.Debugging.PowerShellDebugContext.ProcessDebuggerResult(DebuggerCommandResults debuggerResult) in D:\a\1\s\src\PowerShellEditorServices\Services\PowerShell\Debugging\PowerShellDebugContext.cs:line 154
   at Microsoft.PowerShell.EditorServices.Services.PowerShell.Execution.SynchronousPowerShellTask`1.ExecuteInDebugger(CancellationToken cancellationToken) in D:\a\1\s\src\PowerShellEditorServices\Services\PowerShell\Execution\SynchronousPowerShellTask.cs:line 196
   at Microsoft.PowerShell.EditorServices.Services.PowerShell.Execution.SynchronousPowerShellTask`1.Run(CancellationToken cancellationToken) in
D:\a\1\s\src\PowerShellEditorServices\Services\PowerShell\Execution\SynchronousPowerShellTask.cs:line 55
   at Microsoft.PowerShell.EditorServices.Services.PowerShell.Execution.SynchronousTask`1.ExecuteSynchronously(CancellationToken executorCancellationToken) in D:\a\1\s\src\PowerShellEditorServices\Services\PowerShell\Execution\SynchronousTask.cs:line 104
--- End of stack trace from previous location ---
   at Microsoft.PowerShell.EditorServices.Services.PowerShell.Execution.SynchronousTask`1.get_Result() in D:\a\1\s\src\PowerShellEditorServices\Services\PowerShell\Execution\SynchronousTask.cs:line 60
   at Microsoft.PowerShell.EditorServices.Services.PowerShell.Execution.SynchronousTask`1.ExecuteAndGetResult(CancellationToken cancellationToken) in D:\a\1\s\src\PowerShellEditorServices\Services\PowerShell\Execution\SynchronousTask.cs:line 109
   at Microsoft.PowerShell.EditorServices.Services.PowerShell.Host.PsesInternalHost.InvokePSCommand[TResult](PSCommand psCommand, PowerShellExecutionOptions executionOptions, CancellationToken cancellationToken) in D:\a\1\s\src\PowerShellEditorServices\Services\PowerShell\Host\PsesInternalHost.cs:line 371
   at Microsoft.PowerShell.EditorServices.Services.PowerShell.Host.PsesInternalHost.InvokePSCommand(PSCommand psCommand, PowerShellExecutionOptions executionOptions, CancellationToken cancellationToken) in D:\a\1\s\src\PowerShellEditorServices\Services\PowerShell\Host\PsesInternalHost.cs:line 375
   at Microsoft.PowerShell.EditorServices.Services.PowerShell.Host.PsesInternalHost.InvokeInput(String input, CancellationToken cancellationToken) in D:\a\1\s\src\PowerShellEditorServices\Services\PowerShell\Host\PsesInternalHost.cs:line 678
   at Microsoft.PowerShell.EditorServices.Services.PowerShell.Host.PsesInternalHost.DoOneRepl(CancellationToken cancellationToken) in D:\a\1\s\src\PowerShellEditorServices\Services\PowerShell\Host\PsesInternalHost.cs:line 640

Script Used

Describe 'ConvertTo-ReliefJetPST' {
    BeforeAll {
        Import-Module $PSScriptRoot/PSTMigration.psm1 -Force
        $SCRIPT:Mocks = Resolve-Path (Join-Path $PSScriptRoot $PSTMigration.Mocks)
    }
    It 'Folder with MSG files, different destination' {

        $MockSource = Join-Path $Mocks 'FolderWithMsgFile'
        $MockSource
        | ConvertTo-ReliefJetPST -Destination 'TestDrive:/'
    }
}

Originally posted by @JustinGrote in #1642 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs: Triage Maintainer attention needed!
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant