1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-23 17:05:26 +02:00

Bug 429534 - NPE in CElementHyperlinkDetector.detectHyperlinks()

Change-Id: I9572985aa6585a47d5230adad813fdb6639748bf
Signed-off-by: Nathan Ridge <zeratul976@hotmail.com>
Reviewed-on: https://git.eclipse.org/r/38394
Tested-by: Hudson CI
Reviewed-by: Sergey Prigogin <eclipse.sprigogin@gmail.com>
Tested-by: Sergey Prigogin <eclipse.sprigogin@gmail.com>
This commit is contained in:
Nathan Ridge 2014-12-16 23:08:23 -05:00 committed by Sergey Prigogin
parent 5ccf40dd20
commit 57fbe42664

View file

@ -142,7 +142,7 @@ public class CElementHyperlinkDetector extends AbstractHyperlinkDetector {
scanner.setSource(document.get().toCharArray());
scanner.setCurrentPosition(findPreprocessorDirectiveStart(document, region.getOffset()));
Token token = scanner.nextToken();
if (token.getType() == Token.tPREPROCESSOR_INCLUDE) {
if (token != null && token.getType() == Token.tPREPROCESSOR_INCLUDE) {
int endPos = token.getOffset() + token.getLength();
// Trim trailing whitespace.
while (Character.isWhitespace(document.getChar(--endPos))) {