Skip to content

Added null pointer check for client capabilities #424

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

Merged
merged 1 commit into from
May 14, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions patches/nb-telemetry.diff
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ index 9134992f5f..f070fec320 100644
if (caps == null) {
caps = new ClientCapabilities();
diff --git a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/Server.java b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/Server.java
index 13cbcdd628..4b02a84c8b 100644
index 13cbcdd628..747d151600 100644
--- a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/Server.java
+++ b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/Server.java
@@ -164,7 +164,6 @@ public final class Server {
Expand Down Expand Up @@ -445,7 +445,7 @@ index 13cbcdd628..4b02a84c8b 100644
public CompletableFuture<InitializeResult> initialize(InitializeParams init) {
NbCodeClientCapabilities capa = NbCodeClientCapabilities.get(init);
client.setClientCaps(capa);
+ if (capa.wantsTelemetryEnabled()) {
+ if (capa != null && capa.wantsTelemetryEnabled()) {
+ LspServerTelemetryManager.getInstance().connect(client, lspSession.getLspServer().getRunningFuture());
+ }
hackConfigureGroovySupport(capa);
Expand Down