Skip to content

Commit

Permalink
Fixed NPE in IncludeTaglet.
Browse files Browse the repository at this point in the history
  • Loading branch information
essiembre committed Oct 19, 2024
1 parent 818f2a7 commit adfd9d7
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -240,19 +240,19 @@ static String resolveIncludeDirective(
}

var typeCommentTree = env.getDocTrees().getDocCommentTree(typeEl);

var content = "";
for (DocTree bodyPart : typeCommentTree.getFullBody()) {
if (bodyPart.getKind() == UNKNOWN_INLINE_TAG) {
var tag = TagContent.of(
TagletUtil.toUnknownInlineTagTreeOrFail(bodyPart));
if (tag.isPresent() && directive.matches(tag.get())) {
content = tag.get().getContent();
break;
if (typeCommentTree != null) {
for (DocTree bodyPart : typeCommentTree.getFullBody()) {
if (bodyPart.getKind() == UNKNOWN_INLINE_TAG) {
var tag = TagContent.of(
TagletUtil.toUnknownInlineTagTreeOrFail(bodyPart));
if (tag.isPresent() && directive.matches(tag.get())) {
content = tag.get().getContent();
break;
}
}
}
}

return resolveContentIncludes(content, env);
}
}

0 comments on commit adfd9d7

Please sign in to comment.