diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/renderer/KorteJavadocRenderer.kt | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/renderer/KorteJavadocRenderer.kt b/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/renderer/KorteJavadocRenderer.kt index 91e8189b..1d721611 100644 --- a/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/renderer/KorteJavadocRenderer.kt +++ b/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/renderer/KorteJavadocRenderer.kt @@ -189,8 +189,12 @@ class KorteJavadocRenderer(val context: DokkaContext, resourceDir: String) : private class ResourceTemplateProvider(val basePath: String) : TemplateProvider { override suspend fun get(template: String): String = - javaClass.classLoader.getResourceAsStream("$basePath/$template")?.bufferedReader()?.lines()?.toArray() - ?.joinToString("\n") ?: throw IllegalStateException("Template not found: $basePath/$template") + javaClass.classLoader.getResourceAsStream("$basePath/$template")?.use { stream -> + stream.bufferedReader() + .lines() + .toArray() + .joinToString("\n") + } ?: throw IllegalStateException("Template not found: $basePath/$template") } } |