diff --git a/airin-gradle/src/main/kotlin/org/morfly/airin/GradleTemplateProvidersHolder.kt b/airin-gradle/src/main/kotlin/org/morfly/airin/GradleTemplateProvidersHolder.kt index 7245d289..61e6e587 100644 --- a/airin-gradle/src/main/kotlin/org/morfly/airin/GradleTemplateProvidersHolder.kt +++ b/airin-gradle/src/main/kotlin/org/morfly/airin/GradleTemplateProvidersHolder.kt @@ -37,8 +37,8 @@ class GradleTemplateProvidersHolder( * */ fun providePerModule(target: Project, relativePath: String): List = - providers[GradlePerModuleTemplateProvider]!! - .firstOrNull { it.canProvide(target) } + providers[GradlePerModuleTemplateProvider] + ?.firstOrNull { it.canProvide(target) } ?.provide(target, relativePath) ?: emptyList() @@ -46,9 +46,10 @@ class GradleTemplateProvidersHolder( * */ fun provideStandalone(root: Project): List = - providers[GradleStandaloneTemplateProvider]!! - .filter { it.canProvide(root) } - .flatMap { it.provide(root, relativePath = "") } + providers[GradleStandaloneTemplateProvider] + ?.filter { it.canProvide(root) } + ?.flatMap { it.provide(root, relativePath = "") } + ?: emptyList() /** *