diff options
Diffstat (limited to 'src/Kotlin/ContentBuilder.kt')
-rw-r--r-- | src/Kotlin/ContentBuilder.kt | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Kotlin/ContentBuilder.kt b/src/Kotlin/ContentBuilder.kt index 42a2d994..abe24917 100644 --- a/src/Kotlin/ContentBuilder.kt +++ b/src/Kotlin/ContentBuilder.kt @@ -126,7 +126,9 @@ public fun DocumentationBuilder.buildInlineContentTo(tree: MarkdownNode, target: } } -fun DocumentationBuilder.functionBody(descriptor: DeclarationDescriptor, functionName: String): ContentNode { +fun DocumentationBuilder.functionBody(descriptor: DeclarationDescriptor, functionName: String?): ContentNode { + if (functionName == null) + return ContentBlockCode().let() { it.append(ContentText("Missing function name in @sample")); it } val scope = getResolutionScope(session, descriptor) val rootPackage = session.getModuleDescriptor().getPackage(FqName.ROOT)!! val rootScope = rootPackage.getMemberScope() |