Skip to content

Commit

Permalink
Fix an NPE in InvalidLink
Browse files Browse the repository at this point in the history
Discovered while validating 2.4.0 release (#1639)

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=313487177
  • Loading branch information
cushon committed May 29, 2020
1 parent c085dc1 commit 16b25b4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ public Void visitErroneous(ErroneousTree erroneousTree, Void unused) {

@Override
public Void visitLink(LinkTree linkTree, Void unused) {
if (linkTree.getReference() == null) {
return super.visitLink(linkTree, null);
}
String reference = linkTree.getReference().getSignature();
Element element = null;
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,4 +157,16 @@ public void multiField() {
"}")
.doTest();
}

@Test
public void emptyLinkTest() {
helper
.addSourceLines(
"Test.java", //
"interface Test {",
" /** {@link} */",
" void foo();",
"}")
.doTest();
}
}

0 comments on commit 16b25b4

Please sign in to comment.