Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Johnston2018-07-31 18:12:58 -0400
committerJeff Johnston2018-07-31 19:53:34 -0400
commitc6ed71641f265641283a790fb500db4ce893eccb (patch)
treef399c1140a4a88b0114bb2594d0104d10d4d5747
parent3961f71bb211bda7d71e1a71c96017282830decd (diff)
downloadorg.eclipse.linuxtools-c6ed71641f265641283a790fb500db4ce893eccb.tar.gz
org.eclipse.linuxtools-c6ed71641f265641283a790fb500db4ce893eccb.tar.xz
org.eclipse.linuxtools-c6ed71641f265641283a790fb500db4ce893eccb.zip
Bug 515699 - NPE in Staging View - GNUHyperlinkDetector.detectHyperlinks
- add null check after calling getLocation() in detectHyperlinks Change-Id: I4a86500383d8483287583fb28d4797b03d090afb Reviewed-on: https://git.eclipse.org/r/126854 Tested-by: CI Bot Reviewed-by: Jeff Johnston <jjohnstn@redhat.com> (cherry picked from commit f3ffb7ff20d666fac24227f2a37d02d1e4516dc9) Reviewed-on: https://git.eclipse.org/r/126858
-rw-r--r--changelog/org.eclipse.linuxtools.changelog.core/src/org/eclipse/linuxtools/internal/changelog/core/editors/GNUHyperlinkDetector.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/changelog/org.eclipse.linuxtools.changelog.core/src/org/eclipse/linuxtools/internal/changelog/core/editors/GNUHyperlinkDetector.java b/changelog/org.eclipse.linuxtools.changelog.core/src/org/eclipse/linuxtools/internal/changelog/core/editors/GNUHyperlinkDetector.java
index b032078a9a..00c4068418 100644
--- a/changelog/org.eclipse.linuxtools.changelog.core/src/org/eclipse/linuxtools/internal/changelog/core/editors/GNUHyperlinkDetector.java
+++ b/changelog/org.eclipse.linuxtools.changelog.core/src/org/eclipse/linuxtools/internal/changelog/core/editors/GNUHyperlinkDetector.java
@@ -45,7 +45,11 @@ public class GNUHyperlinkDetector extends AbstractHyperlinkDetector {
if (buffer == null) {
return null;
}
- documentLocation = buffer.getLocation().removeLastSegments(1);
+ IPath p = buffer.getLocation();
+ if (p == null) {
+ return null;
+ }
+ documentLocation = p.removeLastSegments(1);
}
IDocument thisDoc = textViewer.getDocument();

Back to the top