diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Kotlin/DocumentationBuilder.kt | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/Kotlin/DocumentationBuilder.kt b/src/Kotlin/DocumentationBuilder.kt index 99c81760..844d8290 100644 --- a/src/Kotlin/DocumentationBuilder.kt +++ b/src/Kotlin/DocumentationBuilder.kt @@ -127,7 +127,7 @@ class DocumentationBuilder(val session: ResolveSession, val options: Documentati fun DocumentationNode.appendAnnotations(annotated: Annotated) { annotated.getAnnotations().forEach { - append(it.build(), DocumentationReference.Kind.Annotation) + it.build()?.let { append(it, DocumentationReference.Kind.Annotation) } } } @@ -325,8 +325,11 @@ class DocumentationBuilder(val session: ResolveSession, val options: Documentati return node } - fun AnnotationDescriptor.build(): DocumentationNode { + fun AnnotationDescriptor.build(): DocumentationNode? { val annotationClass = getType().getConstructor().getDeclarationDescriptor() + if (ErrorUtils.isError(annotationClass)) { + return null + } val node = DocumentationNode(annotationClass.getName().asString(), Content.Empty, DocumentationNode.Kind.Annotation) val arguments = getAllValueArguments().toList().sortBy { it.first.getIndex() } arguments.forEach { |