Skip to content

Commit

Permalink
fix: add null checking
Browse files Browse the repository at this point in the history
  • Loading branch information
Anakael committed Jan 21, 2025
1 parent 56dadd8 commit e91885e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/OmniSharp.LanguageServerProtocol/LanguageServerHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public class LanguageServerHost : IDisposable
private CompositionHost _compositionHost;
private IServiceProvider _serviceProvider;
private readonly Action<ILoggingBuilder> _configureLogging;
private IObserver<WorkDoneProgressReport> _workDoneObserver = null!;
private IObserver<WorkDoneProgressReport> _workDoneObserver;

public LanguageServerHost(
Stream input,
Expand Down Expand Up @@ -145,12 +145,12 @@ await Task.WhenAll(
.Select(ps => ps.WaitForIdleAsync())
.ToArray());

_workDoneObserver.OnNext(new WorkDoneProgressReport
_workDoneObserver?.OnNext(new WorkDoneProgressReport
{
Message = "Language Server ready",
Percentage = 100,
});
_workDoneObserver.OnCompleted();
_workDoneObserver?.OnCompleted();

Console.CancelKeyPress += (sender, e) =>
{
Expand Down

0 comments on commit e91885e

Please sign in to comment.