This is an automated email from the ASF dual-hosted git repository.
sdedic pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git
The following commit(s) were added to refs/heads/master by this push:
new a650888 Avoid NPE if hyperlink belongs to another provider.
new 575c97d Merge pull request #3026 from sdedic/sdedic/hyperlink-npe
a650888 is described below
commit a650888e41f4abac2ca2f7b815ac476dbaa1a0d2
Author: Svata Dedic <[email protected]>
AuthorDate: Wed Jun 30 10:36:38 2021 +0200
Avoid NPE if hyperlink belongs to another provider.
---
ide/editor/src/org/netbeans/modules/editor/url/HyperlinkImpl.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/ide/editor/src/org/netbeans/modules/editor/url/HyperlinkImpl.java
b/ide/editor/src/org/netbeans/modules/editor/url/HyperlinkImpl.java
index 5ffe996..fa093a2 100644
--- a/ide/editor/src/org/netbeans/modules/editor/url/HyperlinkImpl.java
+++ b/ide/editor/src/org/netbeans/modules/editor/url/HyperlinkImpl.java
@@ -277,7 +277,9 @@ public final class HyperlinkImpl implements
HyperlinkProviderExt, HyperlinkLocat
@Override
public CompletableFuture<HyperlinkLocation> getHyperlinkLocation(Document
doc, int offset) {
int[] span = this.getHyperlinkSpan(doc, offset,
HyperlinkType.GO_TO_DECLARATION);
-
+ if (span == null) {
+ return CompletableFuture.completedFuture(null);
+ }
return CompletableFuture.supplyAsync(() -> {
try {
String urlText = doc.getText(span[0], span[1] - span[0]);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists