aboutsummaryrefslogtreecommitdiff
path: root/plugins/base
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/base')
-rw-r--r--plugins/base/src/main/kotlin/renderers/FileWriter.kt3
1 files changed, 2 insertions, 1 deletions
diff --git a/plugins/base/src/main/kotlin/renderers/FileWriter.kt b/plugins/base/src/main/kotlin/renderers/FileWriter.kt
index 9fcd3eb5..e195f23c 100644
--- a/plugins/base/src/main/kotlin/renderers/FileWriter.kt
+++ b/plugins/base/src/main/kotlin/renderers/FileWriter.kt
@@ -79,7 +79,8 @@ class FileWriter(val context: DokkaContext): OutputWriter {
val filePath = file.toAbsolutePath().toString()
withContext(Dispatchers.IO) {
Paths.get(root.path, rebase(filePath)).toFile().writeBytes(
- this@FileWriter.javaClass.getResourceAsStream(filePath).readBytes()
+ this@FileWriter.javaClass.getResourceAsStream(filePath).use { it?.readBytes() }
+ ?: throw IllegalStateException("Can not get a resource from $filePath")
)
}
}