Skip to content

Commit

Permalink
Fix nil pointer dereference in workspace capabilities check
Browse files Browse the repository at this point in the history
This will fix bufbuild#3581
  • Loading branch information
micheam committed Jan 12, 2025
1 parent c60d858 commit b616fbe
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion private/buf/buflsp/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ func (s *server) Initialized(
ctx context.Context,
params *protocol.InitializedParams,
) error {
if s.initParams.Load().Capabilities.Workspace.DidChangeConfiguration.DynamicRegistration {
workspaceCapabilities := s.initParams.Load().Capabilities.Workspace
if workspaceCapabilities != nil && workspaceCapabilities.DidChangeConfiguration.DynamicRegistration {
// The error is logged for us by the client wrapper.
_ = s.client.RegisterCapability(ctx, &protocol.RegistrationParams{
Registrations: []protocol.Registration{
Expand Down

0 comments on commit b616fbe

Please sign in to comment.