aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Johnston2018-07-31 18:12:58 -0400
committerJeff Johnston2018-07-31 19:04:57 -0400
commitf3ffb7ff20d666fac24227f2a37d02d1e4516dc9 (patch)
tree33a6fc5dd9171666d147604031f6bc16334b92b3
parent4778a0ff6702932ec2623321f9ece8199c1035c1 (diff)
downloadorg.eclipse.linuxtools-f3ffb7ff20d666fac24227f2a37d02d1e4516dc9.tar.gz
org.eclipse.linuxtools-f3ffb7ff20d666fac24227f2a37d02d1e4516dc9.tar.xz
org.eclipse.linuxtools-f3ffb7ff20d666fac24227f2a37d02d1e4516dc9.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>
-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();