1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-16 13:35:22 +02:00

Bug 541117 - NPE in CElementHyperlinkDetector.isLanguageKeyword

Change-Id: I4bd2155de5aa7a09cb9e68f57e1168bdaab76401
This commit is contained in:
Nathan Ridge 2018-11-15 21:50:40 -05:00
parent 0c7b32c0dd
commit ac68d83566

View file

@ -206,6 +206,7 @@ public class CElementHyperlinkDetector extends AbstractHyperlinkDetector {
*/
private static IRegion getIdentifier(IDocument document, int offset, ILanguage language)
throws BadLocationException {
if (language != null) {
IRegion wordRegion = CWordFinder.findWord(document, offset);
if (wordRegion != null && wordRegion.getLength() > 0) {
String word = document.get(wordRegion.getOffset(), wordRegion.getLength());
@ -215,6 +216,7 @@ public class CElementHyperlinkDetector extends AbstractHyperlinkDetector {
}
}
}
}
return null;
}