Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Null dereference when debugging Pester tests #1672

Copy link
Copy link
@andyleejordan

Description

@andyleejordan
Issue body actions

@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)

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs: TriageMaintainer attention needed!Maintainer attention needed!

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.