aboutsummaryrefslogtreecommitdiff
path: root/plugins/gfm/src
diff options
context:
space:
mode:
authorKamil Doległo <kamilok1965@interia.pl>2020-08-14 13:25:48 +0200
committerSebastian Sellmair <34319766+sellmair@users.noreply.github.com>2020-08-19 13:34:10 +0200
commitc3e979270956b8df9380cf9eea067048f325dbd3 (patch)
treec4ebc524e68aabdf1f8486f2785ee783c28c66af /plugins/gfm/src
parentcd52a20e56abcb15ebc11659bc79cac6a9b56a75 (diff)
downloaddokka-c3e979270956b8df9380cf9eea067048f325dbd3.tar.gz
dokka-c3e979270956b8df9380cf9eea067048f325dbd3.tar.bz2
dokka-c3e979270956b8df9380cf9eea067048f325dbd3.zip
Replace !! with some meaningful messages
Diffstat (limited to 'plugins/gfm/src')
-rw-r--r--plugins/gfm/src/main/kotlin/GfmPlugin.kt10
1 files changed, 8 insertions, 2 deletions
diff --git a/plugins/gfm/src/main/kotlin/GfmPlugin.kt b/plugins/gfm/src/main/kotlin/GfmPlugin.kt
index c758467a..c8f78c26 100644
--- a/plugins/gfm/src/main/kotlin/GfmPlugin.kt
+++ b/plugins/gfm/src/main/kotlin/GfmPlugin.kt
@@ -1,6 +1,8 @@
package org.jetbrains.dokka.gfm
import org.jetbrains.dokka.CoreExtensions
+import org.jetbrains.dokka.DokkaConfiguration.DokkaSourceSet
+import org.jetbrains.dokka.DokkaException
import org.jetbrains.dokka.base.DokkaBase
import org.jetbrains.dokka.base.renderers.DefaultRenderer
import org.jetbrains.dokka.base.renderers.PackageListCreator
@@ -324,7 +326,11 @@ open class CommonmarkRenderer(
}
override suspend fun renderPage(page: PageNode) {
- val path by lazy { locationProvider.resolve(page, skipExtension = true)!! }
+ val path by lazy {
+ locationProvider.resolve(page, skipExtension = true)
+ ?: throw DokkaException("Cannot resolve path for ${page.name}")
+ }
+
when (page) {
is ContentPage -> outputWriter.write(path, buildPage(page) { c, p -> buildPageContent(c, p) }, ".md")
is RendererSpecificPage -> when (val strategy = page.strategy) {
@@ -359,5 +365,5 @@ class MarkdownLocationProvider(
) : DokkaLocationProvider(
pageGraphRoot,
dokkaContext,
-".md"
+ ".md"
) \ No newline at end of file