Skip to content

NullReferenceException from PSES if no folder is open when Preview Extension Loaded #2311

Closed
PowerShell/PowerShellEditorServices
#1107
@JustinGrote

Description

@JustinGrote

System Details

Using VSIX from #2304

System Details Output

11/18/2019 12:58:30 PM [ERROR] - Error: Internal Error - System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.PowerShell.EditorServices.Server.PsesLanguageServer.<>c.<<StartAsync>b__18_3>d.MoveNext() in D:\a\1\PowerShellEditorServices\src\PowerShellEditorServices\Server\PsesLanguageServer.cs:line 114
--- End of stack trace from previous location where exception was thrown ---
   at OmniSharp.Extensions.LanguageServer.Server.LanguageServer.MediatR.IRequestHandler<OmniSharp.Extensions.LanguageServer.Protocol.Models.InitializeParams,OmniSharp.Extensions.LanguageServer.Protocol.Models.InitializeResult>.Handle(InitializeParams request, CancellationToken token)
   at OmniSharp.Extensions.LanguageServer.Server.Pipelines.ResolveCommandPipeline`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)
   at MediatR.Pipeline.RequestPostProcessorBehavior`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)
   at MediatR.Pipeline.RequestPreProcessorBehavior`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)
   at OmniSharp.Extensions.JsonRpc.RequestRouterBase`1.RouteRequest(TDescriptor descriptor, Request request, CancellationToken token)

Expected Behaviour

Extension should load on a new window with no folder specified

Actual Behaviour

"Could not start language service"

Attached Logs

Follow the instructions in the troubleshooting docs
about capturing and sending logs.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions