diff --git a/src/main/java/com/norconex/commons/lang/javadoc/IncludeTaglet.java b/src/main/java/com/norconex/commons/lang/javadoc/IncludeTaglet.java index d532e2c4..16eb45e9 100644 --- a/src/main/java/com/norconex/commons/lang/javadoc/IncludeTaglet.java +++ b/src/main/java/com/norconex/commons/lang/javadoc/IncludeTaglet.java @@ -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); } }