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:
parent
5ccf40dd20
commit
57fbe42664
1 changed files with 1 additions and 1 deletions
|
@ -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))) {
|
||||
|
|
Loading…
Add table
Reference in a new issue