From aeaec3af69324ac16ae3bde4cce5fdca8ff5e8cf Mon Sep 17 00:00:00 2001 From: Achal Talati Date: Tue, 13 May 2025 17:31:16 +0530 Subject: [PATCH] added null pointer check for client capabilities --- patches/nb-telemetry.diff | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/patches/nb-telemetry.diff b/patches/nb-telemetry.diff index a0b65bd..358845e 100644 --- a/patches/nb-telemetry.diff +++ b/patches/nb-telemetry.diff @@ -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 { @@ -445,7 +445,7 @@ index 13cbcdd628..4b02a84c8b 100644 public CompletableFuture 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);