mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-16 21:45:22 +02:00
Bug 541117 - NPE in CElementHyperlinkDetector.isLanguageKeyword
Change-Id: I4bd2155de5aa7a09cb9e68f57e1168bdaab76401
This commit is contained in:
parent
0c7b32c0dd
commit
ac68d83566
1 changed files with 8 additions and 6 deletions
|
@ -206,6 +206,7 @@ public class CElementHyperlinkDetector extends AbstractHyperlinkDetector {
|
||||||
*/
|
*/
|
||||||
private static IRegion getIdentifier(IDocument document, int offset, ILanguage language)
|
private static IRegion getIdentifier(IDocument document, int offset, ILanguage language)
|
||||||
throws BadLocationException {
|
throws BadLocationException {
|
||||||
|
if (language != null) {
|
||||||
IRegion wordRegion = CWordFinder.findWord(document, offset);
|
IRegion wordRegion = CWordFinder.findWord(document, offset);
|
||||||
if (wordRegion != null && wordRegion.getLength() > 0) {
|
if (wordRegion != null && wordRegion.getLength() > 0) {
|
||||||
String word = document.get(wordRegion.getOffset(), wordRegion.getLength());
|
String word = document.get(wordRegion.getOffset(), wordRegion.getLength());
|
||||||
|
@ -215,6 +216,7 @@ public class CElementHyperlinkDetector extends AbstractHyperlinkDetector {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue